Change scroll direction

Last post 09-01-2011, 5:25 AM by WebEngineer. 2 replies.
Sort Posts: Previous Next
  •  08-26-2011, 8:59 AM 69836

    Change scroll direction

    In the SlideShow Layout the order of displaying the images is from right to left and this is counterintuitive to me. How do I change this?
  •  08-30-2011, 7:34 AM 69873 in reply to 69836

    Re: Change scroll direction

    Hi WebEngineer ,

    Please try the way below

    Step 1-3 change the scrollbar to rightàleft

    1. Open file "\CuteSoft_Client\Gallery\Layout\SlideShow\Code.js"

    2. Find method below

    GalleryLayout.prototype.GetNextPhoto=function _GalleryLayout_GetNextPhoto(photo,backward)

    {

    var photos=[];

    for(var i=0;i<this._categories.length;i++)

    {

    photos=photos.concat(this._categories[i].Photos);

    }

    if(photos.length==0)

    return null;

    var nextphoto;

    for(var i=0;i<photos.length;i++)

    {

    var p=photos[i];

    if(p.CategoryID==photo.CategoryID&&p.PhotoID==photo.PhotoID)

    {

    if(backward)

    nextphoto=photos[i-1];

    else

    nextphoto=photos[i+1];

    break;

    }

    }

    if(nextphoto)

    return nextphoto;

    if(backward)

    return photos[photos.length-1];

    return photos[0];

    }

    3. Change to

    GalleryLayout.prototype.GetNextPhoto=function _GalleryLayout_GetNextPhoto(photo,backward)

    {

    var photos=[];

    for(var i=0;i<this._categories.length;i++)

    {

    photos=photos.concat(this._categories[i].Photos);

    }

    if(photos.length==0)

    return null;

    var nextphoto;

    for(var i=0;i<photos.length;i++)

    {

    var p=photos[i];

    if(p.CategoryID==photo.CategoryID&&p.PhotoID==photo.PhotoID)

    {

    if(backward)

    nextphoto=photos[i+1];

    else

    nextphoto=photos[i-1];

    break;

    }

    }

    if(nextphoto)

    return nextphoto;

    if(backward)

    return photos[photos.length-1];

    return photos[photos.length-1];

    }

    Step 4-5 ensure that you click on the photo(next/prev) can go to the correct photo

    4. Find section below

    case "Next":

    clearTimeout(this.playtimerid);

    this.ShowPhoto(this.GetNextPhoto(this._showingphoto));

    break;

    case "Prev":

    clearTimeout(this.playtimerid);

    this.ShowPhoto(this.GetPrevPhoto(this._showingphoto));

    break;

    5. Change to

    case "Prev":

    clearTimeout(this.playtimerid);

    this.ShowPhoto(this.GetNextPhoto(this._showingphoto));

    break;

    case "Next":

    clearTimeout(this.playtimerid);

    this.ShowPhoto(this.GetPrevPhoto(this._showingphoto));

    break;

    Step 6-8 ensure that in the full page mode you click on the photo(next/prev) can go to the correct photo

    6. Open file "\CuteSoft_Client\Gallery\Viewer\LightBox\Code.js"

    7. Find section below

    GalleryViewer.prototype.GetNextPhoto=function _GalleryViewer_GetNextPhoto(photo,backward)

    {

    var cs=this.Browser.GetCategories()

    var photos=[];

    for(var i=0;i<cs.length;i++)

    {

    photos=photos.concat(cs[i].Photos);

    }

    photos=BubbleSort(photos);

    if(photos.length==0)

    return null;

    var nextphoto;

    for(var i=0;i<photos.length;i++)

    {

    var p=photos[i];

    if(p.CategoryID==photo.CategoryID&&p.PhotoID==photo.PhotoID)

    {

    if(backward)

    nextphoto=photos[i-1];

    else

    nextphoto=photos[i+1];

    break;

    }

    }

    if(nextphoto)

    return nextphoto;

    if(backward)

    return photos[photos.length-1];

    return photos[0];

    }

    8. Change to

    GalleryViewer.prototype.GetNextPhoto=function _GalleryViewer_GetNextPhoto(photo,backward)

    {

    var cs=this.Browser.GetCategories()

    var photos=[];

    for(var i=0;i<cs.length;i++)

    {

    photos=photos.concat(cs[i].Photos);

    }

    photos=BubbleSort(photos);

    if(photos.length==0)

    return null;

    var nextphoto;

    for(var i=0;i<photos.length;i++)

    {

    var p=photos[i];

    if(p.CategoryID==photo.CategoryID&&p.PhotoID==photo.PhotoID)

    {

    if(backward)

    nextphoto=photos[i+1];

    else

    nextphoto=photos[i-1];

    break;

    }

    }

    if(nextphoto)

    return nextphoto;

    if(backward)

    return photos[photos.length-1];

    return photos[photos.length-1];

    }

    Regards,

    Ken

  •  09-01-2011, 5:25 AM 69902 in reply to 69873

    Re: Change scroll direction

    Thank you, Kenneth.
    I have decided it will be easier and faster for me to develop my own routine for my own needs than it will to try to follow and modify someone else's code. You have done a great job, though. 

View as RSS news feed in XML