Hi, I'm working on the same issue with Cycle. I have multiple slideshows on
a page, each with current/total slide counter, example: "2 of 5 images"
(oddly, there are no examples of this particular implementation on Mike
Alsup's otherwise ridiculously varied and helpful cycle demo pages). and so
I've scoured the webs and found this thread and tried to make it work.
Everything seems to be in place, but for some reason it's not working. I'm
assuming it's probably because of misnamed IDs in the css or the below
function was written for an earlier version of either jquery or cycle
plugin.

here's a link to view the page: http://tinyurl.com/kuhsk2

can anyone help me? purdy please.

// Ed


Phillip-25 wrote:
> 
> 
> That worked perfectly. Thank for your help, I was completely stumped.
> 
> On Sep 24, 11:51 am, dlimpid <dlim...@gmail.com> wrote:
>> try this:
>>
>> $(function() {
>>   $('*').filter(function() { return this.id.match(/^s\d+$/); })
>>     .each(function(n) {
>>       $(this).cycle({
>>         timeout: 0,
>>         speed: 500,
>>         fx: 'fade',
>>         prev: '#s' + (n + 1) + '_prev',
>>         next: '#s' + (n + 1) + '_next',
>>         after: function(curr, next, opts) {
>>           $('#s' + (n + 1) + '_current').html((opts.currSlide + 1) + "
>> of " + opts.slideCount + " images");
>>         }
>>       });
>>     });
>>
>> });
>>
>> I think that the problem of original code was the scope of the closer
>> of before function doesn't contains slideShow variable.
>>
>> There was another problem with before callback. I think at very first
>> time, i.e. when page is just loaded, in before callback function
>> opts.nextSlide has wrong value. (try before and opts.nextSlide instead
>> of after and opts.currSlide)
>>
>> On Sep 24, 6:54 am, Phillip <phillipzel...@gmail.com> wrote:
>>
>> > Thanks for the reply. I gave it shot, but still no dice. The good news
>> > is opts.slideCount is working. But opts.nextSlide doesn't seem to
>> > update when you click ahead. Any ideas on what to try next?
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/jQuery-Cycle---Get-Current-Slide-Number-tp19635519s27240p24746475.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

Reply via email to