Hi Charlie,
I'm sorry i don't think i'm making myself clear enough. here is the init.js
file that i'm using, you can see the repeated code for each instance of the
slideshow: http://tinyurl.com/mrhkym
as you can see, lots of duplicated code to deal with each unique instance of
the slideshow.
Charlie Tomlinson wrote:
>
>
>
>
> constructor you are showing is only about 10 lines. If the onAfter is
> identical events for both you should be able to re use the same
> function
> after: onAfter1 for both
>
> Ed F. wrote:
>
>
> Hi Charlie, thanks for the reply, i appreciate it.
>
> That's what I'm doing: repeating the constructor and changing the IDs.
> this
> adds 200 extra lines of code to the js file though. Previously in this
> thread, someone else figured out a way to not have to add unique IDs to
> the
> html code. so that there was only one constructor statement, with no
> repeated code. But alas I couldn't get it to work.
>
> There should be a way for js to loop through the html and create unique
> variables for each slideshow encounter ("#s + 1" or something like that).
>
> any thoughts?
>
>
> Charlie Tomlinson wrote:
>
>
>
>
>
>
>
>
> sorry , your next and prev  ID's will need to be unique, change
> them
> iin new constructor
>
> Ed F. wrote:
>
>
>
> I figured out a way to make the "current slide number" work for multiple
> slideshows on the same page, but i have to repeat the function
> declarations
> for each instance of a slideshow, like so:
>
> <code>
> // init for the cycle js
> $(document).ready(function(){
> $('#s1').cycle({
> fx:'fade',
> speed:'2000',
> timeout: 0,
> next:'#next1, #s1',
> prev:'#prev1',
> after: onAfter1
> });
> });
>
> function onAfter1(curr,next,opts) {
> var caption1 = (opts.currSlide + 1) + '/' + opts.slideCount;
> $('#caption1').html(caption1);
> }
> </code>
>
> I don't have the jscript superpowers to rewrite these functions to accept
> multiple slideshows. anyone have any advice?
>
>
>
>
> Ed F. wrote:
>
>
>
> hi Mike,
>
> thank you for replying. your plugin is awesome.
>
> On thing, in your example, you only have one slideshow on the page, I have
> multiple slideshows on the page with the updating count. and I can get the
> updated count to work for the firat instance of the slideshow but it
> breaks for the rest. any ideas?
>
> thanks,
>
> // Ed
>
>
> malsup wrote:
>
>
>
>
>
> 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).
>
>
> There is an example of this:
>
> http://www.malsup.com/jquery/cycle/count.html
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
--
View this message in context:
http://www.nabble.com/jQuery-Cycle---Get-Current-Slide-Number-tp19635519s27240p24832950.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.