Skip to content

Commit 4913845

Browse files
2 parents dd25367 + d020201 commit 4913845

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

jquery.slimscroll.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@
9393
// used in event handlers and for better minification
9494
var me = $(this);
9595

96+
// create a simple function to check if panel is being hovered over.
97+
isOverPanel = function () {
98+
return me.is(":hover");
99+
}
100+
96101
// ensure we are not binding it again
97102
if (me.parent().hasClass(o.wrapperClass))
98103
{
@@ -256,11 +261,9 @@
256261

257262
// show on parent mouseover
258263
me.hover(function(){
259-
isOverPanel = true;
260264
showBar();
261265
hideBar();
262266
}, function(){
263-
isOverPanel = false;
264267
hideBar();
265268
});
266269

@@ -314,7 +317,7 @@
314317
function _onWheel(e)
315318
{
316319
// use mouse wheel only when mouse is over
317-
if (!isOverPanel) { return; }
320+
if (!isOverPanel()) { return; }
318321

319322
var e = e || window.event;
320323

@@ -447,7 +450,7 @@
447450
if (!o.alwaysVisible)
448451
{
449452
queueHide = setTimeout(function(){
450-
if (!(o.disableFadeOut && isOverPanel) && !isOverBar && !isDragg)
453+
if (!(o.disableFadeOut && isOverPanel()) && !isOverBar && !isDragg)
451454
{
452455
bar.fadeOut('slow');
453456
rail.fadeOut('slow');

0 commit comments

Comments
 (0)