> The Cycle Plugin does this for you.  The active pager element will
> have an "activeSlide" class assigned to it.  If you want to roll your
> own then you can get the index like this:
>
> function onBefore() {
>     var index = $(this).index();
>     // update controls...
>
> }
>
> Mike

Thanks for the reply Mike. The "activeSlide" class is great to know.

I'm still having trouble accessing the index in my own function. I
tried the above code before posting here and get -1 indicating there
is no match.

If I look at the contents of "this" it appears to be the current
slide. Yet if I try to get the contents of a div with class "label"
which is found in the current slide it doesn't work. Such as: var
labelText = $(this).filter(".label").text(); I'm just a little
confused as to what I'm actually dealing with when I use "this." For
instance if I check $("#feature-player").index(this); I get nothing
(feature-player being the id of the wrapper for the whole slideshow).
But if I check $("*").index(this) I do get numbers returned. But the
numbers aren't useful unless I know what the context of the indexing
is. Maybe I'm missing something simple here. Any help would be
appreciated.

What I'm trying to do is access a label for each slide. I currently
have the label inside each slide div. So however I can access this
would be great. But as I've described above - both solutions I can
think of don't seem to be working.

Again - thanks so much for your response. I appreciate you sharing
your knowledge.

Reply via email to