Re: Image Order

  •  08-03-2010, 3:44 AM

    Re: Image Order

    Hi eldong,
     
    1. Open file "\CuteSoft_Client\Gallery\Layout\SlideShow\Code.js"
     
    2. Find section below
     
    div.appendChild(nobr);
     this.items=[];
     
    3. Add the section below under the section above
     
     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(GalleryFormatTimeHTML(arr[j+1].Time) <GalleryFormatTimeHTML(arr[j].Time))
                    {
                        temp = arr[j+1];
                        arr[j+1] = arr[j];
                        arr[j] = temp;
                        exchange = true;
                    }
                }
                if(!exchange) break;
            }
            return arr;
         }
        photos=BubbleSort(photos);
     
    4. Like
     
    div.appendChild(nobr);
     this.items=[];
      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(GalleryFormatTimeHTML(arr[j+1].Time) <GalleryFormatTimeHTML(arr[j].Time))
                    {
                        temp = arr[j+1];
                        arr[j+1] = arr[j];
                        arr[j] = temp;
                        exchange = true;
                    }
                }
                if(!exchange) break;
            }
            return arr;
         }
        photos=BubbleSort(photos);
     
    5. You can switch "<" to  ">" to change the order
     
    Regards,
     
    Ken
View Complete Thread