Was trying some other options and basically figured out the indexing/
setting the id issue: .attr('id', 'pane-' + ((LENGTH - startingPane) +
i) % LENGTH ). I am still curious about this codes performance though
and any suggestions as to how it could be made better. Thanks,On Sep 14, 10:43 am, roryreiff <[email protected]> wrote: > I would also be interested in comments/suggestions about how this code > or even approach could be simplified/improved. It seems pretty > lightweight and simple to me, but I have very little idea about it's > performance and am curious if I am doing something that is unnecessary > or just plain pointless. > > On Sep 14, 10:28 am, roryreiff <[email protected]> wrote: > > > 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 > > athttp://www.pomona.edu/dev/home/spotlight-gallery.jsandthe page > > calling it athttp://pomona.edu/dev/home/index.asp > > > Thanks for any help/input you can give.

