hi,
i am a web and app developer. i need some help in a javascript code which belongs to a wordpress plugin - wp-imageflow2. wp-imageflow2 is a image slider with lightbox features. The slider moves from left to right and then back to the 1st image (basically image1 to last image then back to image1).
My aim is to make the slider move first from image1 to lastImage Then lastImage to firstImage. so far i have tried it to go at reverse direction i.e. right to left (lastImage to firstImage). However when the slider is to move in reverse direction, it only moves back to secondLast Image then to lastImage. this is the code i have developed so far:

this.rotate = function()
{
    /* Do nothing if autorotate has been turned off */

    /* slider moves right to left - reverse direction */
    if (thisObject.image_id == thisObject.max-1) {
            thisObject.glideTo(thisObject.image_id-1);
    }   else
    /*   slider moves left to right - forward direction   */
    if (thisObject.image_id < thisObject.max-1) {
            thisObject.glideTo(thisObject.image_id+1);
    } else 
    if (thisObject.image_id > thisObject.max) {
            thisObject.glideTo(thisObject.image_id-1);
    } 



        /* Set up next auto-glide */
        window.setTimeout (thisObject.rotate, thisObject.conf_autorotatepause);
}

Pls help me out. the code is in a file called imageflowplus.js. a file part of wp-imageflow2. the code provided above is changed by me, except for the function - this.rotate.
Your help will be highly appreciated. THanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.