From 9376f3dd044f0145b748a6f0c5ca0943970c4c1a Mon Sep 17 00:00:00 2001 From: efiorello Date: Thu, 19 Nov 2015 16:51:03 -0300 Subject: [PATCH] mouseover option setting te mouseover option as true, the element wont disappear while the mouse will not go out --- js/iosOverlay.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/js/iosOverlay.js b/js/iosOverlay.js index 11f1367..eb0f8ce 100644 --- a/js/iosOverlay.js +++ b/js/iosOverlay.js @@ -7,6 +7,7 @@ var iosOverlay = function(params) { var overlayDOM; var noop = function() {}; + var hideTimeOut = null; var defaults = { onbeforeshow: noop, onshow: noop, @@ -16,6 +17,7 @@ var iosOverlay = function(params) { icon: null, spinner: null, duration: null, + mouseover: null, id: null, parentEl: null }; @@ -102,8 +104,18 @@ var iosOverlay = function(params) { }); } + if(settings.mouseover) { + $(overlayDOM).mouseover( function () { + clearTimeout(hideTimeOut); + }); + + $(overlayDOM).mouseleave( function () { + hide(); + }); + } + if (settings.duration) { - window.setTimeout(function() { + hideTimeOut = window.setTimeout(function() { hide(); }, settings.duration); }