Created
August 3, 2016 22:01
-
-
Save leto/691336b4c14f6e0371d54c1e5ed6476d to your computer and use it in GitHub Desktop.
onbeforeunload from wordpress plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.onbeforeunload = function(e) { | |
var e = e || window.event; | |
if (e) { | |
e.returnValue = wpp.exit_alert_text; | |
} | |
setTimeout( function(){ | |
wpp_popup_function() | |
css_background = jQuery('#cboxClose').css('background'); | |
jQuery('#cboxClose').css('background', css_background ); | |
}, 500 ); | |
window.onbeforeunload = null; | |
return wpp.exit_alert_text; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment