stevenwanderski / bxslider-3

jQuery custom content slider
http://bxslider.com
447 stars 101 forks source link

Auto show, but with only one loop. #122

Open marketingalliance opened 12 years ago

marketingalliance commented 12 years ago

I am stuck on how to get this to work. I want my slideshow to play automatically, but stop when it reaches the last slide.

I figured this would do it, but with infiniteLoop set to false, the slideshow never starts:

$('#slideimage').bxSlider(
{
auto: true,
infiniteLoop: false,
pause: 3000,
speed:1500,
controls: false,
mode:   'fade'

});

Any help is greatly appreciated.

OK, I'm a little closer now. By adding an onLastSlide command, the show auto-plays one time, then stops. But I can't get it to start again. I've tried reloadShow(), but that makes the whole thing disappear.

$(function(){ var slider = $('#slideimage').bxSlider({ auto: true, pause: 3000, speed:1500, infiniteLoop: false, onLastSlide: function(currentSlideNumber, totalSlideQty, currentSlideHtmlObject){ stopShow(); }, controls: false, mode: 'fade' }); $('#replay').click(function(){ slider.startShow(); return false; }); });

BennyHudson commented 12 years ago

Hey,

I think I might be able to help, as I was trying to do the same thing, and then happened to stumble across a solution.

Try this:

$(document).ready(function(){ $('#slider1').bxSlider({ infiniteLoop: false, displaySlideQty: 1, moveSlideQty: 1, mode: 'fade', auto: true, controls: false, onFirstSlide: function(){ startShow(); } }); });

Does that help?

marketingalliance commented 12 years ago

Thanks Benny,

That worked great! Any idea on how to start it again with an external button?

webgile commented 11 years ago

Add SlideSelector will fix the issue.. as its count wrong number of slide without

mybxslider = jQuery('.bxslider').bxSlider({ mode: 'horizontal', slideMargin: 5, preloadImages:'hide', touchEnabled: true, slideSelector:'div.floorplan', pager: false});