Hi,

I'm hoping I can get a bit of help with a logic issue.

I have a horizontal-scrolling content element (similar to 
http://www.ndoherty.biz/demos/coda-slider/1.1.1/#2 this ). It uses three
DIVs with three classes - prev, current, and next. The elements' contents
are loaded from an XML file of hundreds of items. With each navigational
command (i.e. a 'next' link that slides the three elements to the left to
show the 'next' element), the prev/next DIVs are emptied and re-filled with
the correct content from the XML. The problem I have is with re-assigning
classes to the elements to reflect their new positions. Here's the code:

$('#name.current').removeClass('current').addClass('prev');
$('#name.next').removeClass('next').addClass('current');
$('#name.prev').removeClass('prev').addClass('next'); 

I'm sure you can see the issue. I have to change the class of all three
elements, but the third line presents an issue. Then it runs, TWO elements
have the .prev class. It will effectively reverse itself.

So you can see the issue. I'm looking for an alternate technique or idea
here. Your input is greatly appreciated, thanks for your time!
-- 
View this message in context: 
http://old.nabble.com/jQuery-Logic---Three-elements-used-to-cycle-information-tp26278847s27240p26278847.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

Reply via email to