Your old code was :

$('.unselected').click(function(){
  $('.selected').attr('class','unselected');
  $(this).attr('class','selected');
});

Which translates to "if / when unselected is clicked....."

Your new code is the exact same principle, replacing the ($('.unselected').click (the trigger) with the if statement, and keeping the code that was previously within the click function:

if(currentvar >= contentLength){
  $('.selected').attr('class','unselected');
  $(this).attr('class','selected');
}

Regards,
Liam

Lleoun wrote:
You're right, sorry, I didn't explain myself quite well.

There's a conditional clause. If it is true the class name change has
to be triggered.
The class name change could go inside of a function but after a second
thought there's no need for it.

It would be something like:

if(currentvar >= contentLength){
class name change code here
}

Can that be done? how?
I'm restarting jCarousel (automatically positioning it at the begining
when the last element is reached)  and the class name change would do
the trick.

Thanks once again
------------------------------------------------------------------------


No virus found in this incoming message.
Checked by AVG - www.avg.com Version: 8.5.409 / Virus Database: 270.13.112/2392 - Release Date: 09/24/09 05:52:00


Reply via email to