javascript - Bootstrap carousel stop cycling when some event occur -



javascript - Bootstrap carousel stop cycling when some event occur -

using bootstrap carousel had problem stopping auto cycle.

it said in documentation, if set interval:false, carousel won't auto cycle, there nil said do, when need stop auto cycle when event occurs.

lets have code @ project

$('#carousel-images').carousel({ interval: 5000, pause : 'hover' });

then have click event handler, should 2 things

first: n-th slide should set

second: auto-slide should stop

$('.smallslide').click(function(e) { $('#carousel-images').carousel(4); $('#carousel-images').carousel('pause'); }

this code won't trick, because 'pause' tried set @ moment of slide beingness slided.

this work you:

$('.smallslide').click(function(e) { $('#carousel-images').carousel(4); $('#carousel-images').on('slid.bs.carousel', function () { $('#carousel-images').carousel('pause'); }); }

javascript jquery twitter-bootstrap carousel

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -