From 03641239d292acbbe0a07d3014f1703688ad4f50 Mon Sep 17 00:00:00 2001 From: Anton Stroganov Date: Fri, 5 Oct 2012 19:22:16 -0700 Subject: [PATCH] check whether autoplay actually should be restarted after hover --- jquery.roundabout.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/jquery.roundabout.js b/jquery.roundabout.js index df83da2..7462590 100644 --- a/jquery.roundabout.js +++ b/jquery.roundabout.js @@ -247,10 +247,14 @@ if (settings.autoplayPauseOnHover) { self .bind("mouseenter.roundabout.autoplay", function() { - methods.stopAutoplay.apply(self, [true]); + if(settings.autoplay && methods.isAutoplaying.apply(self)) { + methods.stopAutoplay.apply(self, [true]); + } }) .bind("mouseleave.roundabout.autoplay", function() { - methods.startAutoplay.apply(self); + if(settings.autoplay && !methods.isAutoplaying.apply(self)) { + methods.startAutoplay.apply(self); + } }); }