3

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">
Alexander Vogt
  • 17,879
  • 13
  • 52
  • 68
Greg Robertson
  • 99
  • 1
  • 1
  • 9
  • If I set data-stopautoplayontouch="false" to "true" the slider will pause at mouse over but it will not resume at mouse out. – Greg Robertson Oct 05 '13 at 17:02

1 Answers1

2
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/

Art
  • 1,023
  • 1
  • 7
  • 15