javascript - Bootstrap 3 gallery auto slide activating after modal opens? -
i'm using bootstrap 3 , have gallery on home page , modal. have disabled auto slide on gallery using:
function gallerycarousel() { $ub('.carousel').carousel({ pause: true, interval: false }) };
my issue when clicks on button bring modal, gallery starts auto slide again , continue until close modal. strange thing happens after click go second image in gallery start auto slide again.
i've tried several ways fix no avail.
you can see prototype working here: http://copy-writer-otter-74032.netlify.com/
simply advance gallery next slide, click on "profile" button @ bottom of page bring modal - wait few seconds , watch gallery start auto sliding again.
the problem initializing slider data attributes. means default slider applied. reason seems not on auto, because slider won't move when hover on default. open modal, slider not receive hover, , start move. place mouse on header, or open 1 of dropdowns, , you'll see starts moving.
the easy solution add data-interval="false"
slider element. means can remove javascript.
have @ demo created.
whithout data attribute: http://codepen.io/anon/pen/rvraer
data attribute: http://codepen.io/anon/pen/jdzokj
Comments
Post a Comment