Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fotorama Slider: How can I get the slider to pause on mouse over the resume auto play when mouse out?

Fotorama Slider: The slider is set to Autoplay="true" and it works great. How can I get the slider to pause on mouse over then resume auto play when mouse out? Here is my code:

<div class="fotorama" data-width="1170" data-ratio="1170/374" 
     data-max-width="100%" data-autoplay="true" data-autoplay="3000" 
     data-stopautoplayontouch="false">
like image 572
Greg Robertson Avatar asked Jan 31 '26 00:01

Greg Robertson


1 Answers

var $fotorama = $('.fotorama'),
    interval = $fotorama.data('autoplay'),
    fotorama = $fotorama.data('fotorama');

$fotorama.hover(
    function () {
        fotorama.stopAutoplay();
    },
    function () {
        fotorama.startAutoplay(interval);
    }
);

Fiddle: http://jsfiddle.net/aha3xLsy/

like image 76
Art Avatar answered Feb 01 '26 14:02

Art