I want to move slider/carousel automatically without clicking first to start
-
var old = $.fn.carousel $.fn.carousel = function (option) { return this.each(function () { var $this = $(this) , data = $this.data('carousel') , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option) , action = typeof option == 'string' ? option : options.slide if (!data) $this.data('carousel', (data = new Carousel(this, options))) if (typeof option == 'number') data.to(option) else if (action) data[action]() else if (options.interval) data.pause().cycle() }) } $.fn.carousel.defaults = { interval: 1000 , pause: 'hover' }
<script>
$('.carousel-inner').carousel({ interval: 2000 })</script>
I want to move slider/carousel automatically without clicking first to start
-
var old = $.fn.carousel $.fn.carousel = function (option) { return this.each(function () { var $this = $(this) , data = $this.data('carousel') , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option) , action = typeof option == 'string' ? option : options.slide if (!data) $this.data('carousel', (data = new Carousel(this, options))) if (typeof option == 'number') data.to(option) else if (action) data[action]() else if (options.interval) data.pause().cycle() }) } $.fn.carousel.defaults = { interval: 1000 , pause: 'hover' }
<script>
$('.carousel-inner').carousel({ interval: 2000 })</script>
I want to move slider/carousel automatically without clicking first to start
You'll have to look through the code for the carousel plugin and find the click event and instead change that code to run on a timer or however you want it to run.
There are only 10 types of people in the world, those who understand binary and those who don't.
-
var old = $.fn.carousel $.fn.carousel = function (option) { return this.each(function () { var $this = $(this) , data = $this.data('carousel') , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option) , action = typeof option == 'string' ? option : options.slide if (!data) $this.data('carousel', (data = new Carousel(this, options))) if (typeof option == 'number') data.to(option) else if (action) data[action]() else if (options.interval) data.pause().cycle() }) } $.fn.carousel.defaults = { interval: 1000 , pause: 'hover' }
<script>
$('.carousel-inner').carousel({ interval: 2000 })</script>
I want to move slider/carousel automatically without clicking first to start
which carousel you are using. Can you give link for fix you need?