Re: Image Sort Order

  •  01-25-2011, 10:58 PM

    Re: Image Sort Order

    Hi regrossman,
     

    function BubbleSort(arr)
     {

            var temp;
            var exchange;
            for(var i=0; i<arr.length; i++)
            {
                exchange = false;
                for(var j=arr.length-2; j>=i; j--)
                {
              
                    if(arr[j+1].CategoryID <arr[j].CategoryID)
                    {
                    
                        temp = arr[j+1];
                        arr[j+1] = arr[j];
                        arr[j] = temp;
                        exchange = true;
                    }
                }
                if(!exchange) break;
            }
            return arr;
         }
     
     
    Regards,
     
    ken
View Complete Thread