diff --git a/jquery.slimscroll.js b/jquery.slimscroll.js index d219493..4d759ad 100644 --- a/jquery.slimscroll.js +++ b/jquery.slimscroll.js @@ -93,11 +93,6 @@ // used in event handlers and for better minification var me = $(this); - // create a simple function to check if panel is being hovered over. - isOverPanel = function () { - return me.is(":hover"); - } - // ensure we are not binding it again if (me.parent().hasClass(o.wrapperClass)) { @@ -261,9 +256,11 @@ // show on parent mouseover me.hover(function(){ + isOverPanel = true; showBar(); hideBar(); }, function(){ + isOverPanel = false; hideBar(); }); @@ -317,7 +314,7 @@ function _onWheel(e) { // use mouse wheel only when mouse is over - if (!isOverPanel()) { return; } + if (!isOverPanel) { return; } var e = e || window.event; @@ -450,7 +447,7 @@ if (!o.alwaysVisible) { queueHide = setTimeout(function(){ - if (!(o.disableFadeOut && isOverPanel()) && !isOverBar && !isDragg) + if (!(o.disableFadeOut && isOverPanel) && !isOverBar && !isDragg) { bar.fadeOut('slow'); rail.fadeOut('slow');