Skip to content

Commit

Permalink
Fixing unexpected behaviour with mouseout mouseenter
Browse files Browse the repository at this point in the history
  • Loading branch information
juuliaans committed May 17, 2013
1 parent d788e6e commit 478bae2
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions jquery.vticker.js
Expand Up @@ -127,7 +127,7 @@
element: el,
animating: false,
options: options,
isPaused: false
isPaused: (options.startPaused) ? true : false
};
$(this).data('state', state);

Expand Down Expand Up @@ -164,12 +164,18 @@

if(options.mousePause)
{
el.bind("mouseenter",function(){
// stop interval
el.bind("mouseenter", function () {
//if the automatic scroll is paused, don't change that.
if (state.isPaused == true) return;

// stop interval
internal.stopInterval.call( initThis );
methods.pause.call( initThis, true );
}).bind("mouseleave",function(){
methods.pause.call( initThis, false );
}).bind("mouseleave", function () {
//if the automatic scroll is paused, don't change that.
if (state.isPaused == true) return;

methods.pause.call(initThis, false);
// restart interval
internal.startInterval.call( initThis );
});
Expand Down

0 comments on commit 478bae2

Please sign in to comment.