Skip to content

Commit

Permalink
pauseOnPagerHover/pause (hover): only use 0/1 for cyclePause
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Sep 4, 2013
1 parent ac38c7b commit 78a88f1
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions jquery.cycle.all.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,15 +375,12 @@ function buildOptions($cont, $slides, els, options, o) {
$cont.css({height:maxh+'px'});
}

var pauseFlag = false; // https://github.com/malsup/cycle/issues/44
if (opts.pause)
$cont.bind('mouseenter.cycle', function(){
pauseFlag = true;
this.cyclePause++;
this.cyclePause = 1;
triggerPause(cont, true);
}).bind('mouseleave.cycle', function(){
if (pauseFlag)
this.cyclePause--;
this.cyclePause = 0;
triggerPause(cont, true);
});

Expand Down Expand Up @@ -896,16 +893,13 @@ $.fn.cycle.createPagerAnchor = function(i, el, $p, els, opts) {
$a.bind('click.cycle', function(){return false;}); // suppress click

var cont = opts.$cont[0];
var pauseFlag = false; // https://github.com/malsup/cycle/issues/44
if (opts.pauseOnPagerHover) {
$a.hover(
function() {
pauseFlag = true;
cont.cyclePause++;
cont.cyclePause = 1;
triggerPause(cont,true,true);
}, function() {
if (pauseFlag)
cont.cyclePause--;
cont.cyclePause = 0;
triggerPause(cont,true,true);
}
);
Expand Down

0 comments on commit 78a88f1

Please sign in to comment.