jquery - Flexslider sliding doesn't resume after using next/previous controls -


no jquery background, wanted simple carousel dreamweaver built site. working nicely - when click on next/previous arrows move slide forward/backward, on moving cursor off slider (arrows disappear) image stays stuck on last image viewed instead of continuing/resuming functioning slider. meant happen? if so, there way make resume 'play'? thanks

you can try in js code:

solution 1:

$('.flex-next').on('click',function () {     $('.flexslider').flexslider("play"); }); $('.flex-prev').on('click',function () {     $('.flexslider').flexslider("play"); }); 

demo: http://jsfiddle.net/lotusgodkk/n9juc/22/

solution 2: add in flexslider initialisation code.

after: function (slider) {                     if (!slider.playing) {             slider.play();         }     } 

demo: http://jsfiddle.net/lotusgodkk/n9juc/23/

basically, whenever next/prev buttons clicked, call play method, .flex-next , .flex-prev classes on next , previous buttons.

in website, have used:

$(window).load(function () {     $('.flexslider').flexslider(); }); $('.flex-next').on('click', function () {     $('.flexslider').flexslider("play"); }); $('.flex-prev').on('click', function () {     $('.flexslider').flexslider("play"); }); 

instead, use code:

    $(document).ready(function () {     $('.flexslider').flexslider({         after: function (slider) {             if (!slider.playing) {                 slider.play();             }         }     }); }); 

use $(document).ready instead of $(window).load


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -