Hello, Below is a script I am working on for a slideshow for a set of 5 divs. I am generating a random number to represent the index of the starting div, i.e. the one that gets displayed in the middle. All of the other 4 divs get relative indexes so that they appear either to the left or right of the starting div. When the forward or backward buttons get clicked, 4 of the 5 divs animate and the 5th gets positioned to the oppossite far side as it should. My problem is that when I am performing my initial $.getJson call, I need to set an id on each 5 (to the formula of pane-0, pane-1, etc.). This ID determines the initial positioning of the divs. My issue is that I am trying to set that ID in relationship to the variable startingPane, and something isn't getting set right when the starting pane is either the 4th or 5th div.
Once the arrow buttons are clicked, my two functions set everything right and it all works great from there...I am just having an issue with the initial injection and how to set those IDs correctly such that they take my startingPane variable into account and maintain the correct ordering (i.e., the relational order of the panes should always be middle, right, farRight, farLeft, Left and then middle again and so on). Anyone have any suggestions? The jQuery file is viewable at http://www.pomona.edu/dev/home/spotlight-gallery.js and the page calling it at http://pomona.edu/dev/home/index.asp Thanks for any help/input you can give.