Thursday 15 January 2015

jquery - How to disable carousel cycle, when user clicks indicators or carousel controls? -


Using the bootstrap-ready carousel, I want to disable the automatic cycle feature when the user clicks on the indicator or control (next / previous button) Therefore, if the user clicks on the 'next' button, then the carousel is now manual Will happen. JQuery is not strong, but it was my attempt.
  $ ('# myCarousel'). Click (function () {$ (this) .stop ();});    

You can access the interval option through the carousel Set , and false .
  $ ('# myCarousel'). Click (function () {$ (this) .data ('carousel'). Options.interval = false;});   

Demo:

No comments:

Post a Comment