Codeinwp / Nivo-Slider-jQuery

Nivo Slider - The Most Awesome jQuery Image Slider
http://docs.themeisle.com/article/485-getting-started-with-the-nivo-slider-jquery-plugin
MIT License
1.25k stars 606 forks source link

Issue with slideshowEnd Callback #123

Open tags26 opened 13 years ago

tags26 commented 13 years ago

I cannot get the slideshow to stop after the last slide. I'm using the function to stop slideshow per the instructions... I've tried it across browsers. I can get the slideshow to stop if I put it in the afterChange callback, but not the slideshowEnd callback.

This is my code:

slideshowEnd: function(){$('#slider').data('nivo:vars').stop = true;}

tags26 commented 13 years ago

I think i may have found a solution in the javascript file... I changed the 0 to the total amount of slides variable...

This: vars.currentSlide++; if(vars.currentSlide == vars.totalSlides){ vars.currentSlide = 0; //Trigger the slideshowEnd callback settings.slideshowEnd.call(this);

was changed to: vars.currentSlide++; if(vars.currentSlide == vars.totalSlides){ vars.currentSlide = vars.totalSlides; //Trigger the slideshowEnd callback settings.slideshowEnd.call(this);

gilbitron commented 13 years ago

This issue will be fixed by using the lastSlide callback in v2.2:

http://github.com/gilbitron/Nivo-Slider/tree/v2.2

tags26 commented 13 years ago

Great! Love the Nivo-Slider but being able to stop it is a must for my application. Thank you for the quick response and looking forward to getting 2.2