I am having a slide show which marks the slide that is active with the class activeslide
I want to detect each time when the class changes from one li to another.
I tried this:
$('#supersized li').change(function() {
alert('Handler for .change() called.');
});
Then I want to know which slide is active… that is, is it slide-0 or slide-1 etc…
How can I do this with jQuery? I have pasted the list below:
<ul id="supersized" class="quality" style="visibility: visible;">
<li class="slide-0 activeslide" style="visibility: visible; opacity: 1;">
<li class="slide-1" style="visibility: visible; opacity: 1;">
<li class="slide-2" style="visibility: visible; opacity: 1;">
<li class="slide-3 prevslide" style="visibility: visible; opacity: 1;">
</ul>
the .change() event triggers only when controls selection changes, as when selecting an <option> of a <select>
from jQuery .change() documentation
if a class changes if because you changed it. you could use .trigger() (http://api.jquery.com/trigger/) to dispatch a user event from the funciton that changes classes and .bind() (http://api.jquery.com/bind/) to respond to it