Survey_popup
Test popup
by Karen Maritz
HTML
<div id="ask">
<p>Please don't leave this page</p>
</div>
<div id="warning">
<p>I said <b>don't leave this page!</b></p>
<p><a href="#">Got it!</a></p>
</div>
CSS
body { background-color:#f7f7f7; font-family:'Open Sans';}
#ask,#warning {
margin: 2em auto;
width: 50%;
font-size: large;
padding: 2em;
text-align: center;
}
#ask {
background-color: yellow;
}
#warning {
display: none;
background-color: #faa;
}
h1 { margin:50px auto; text-align:center;}
JavaScript
$(function() {
$.exitIntent('enable');
$(document).bind('exitintent', function() {
$("#warning").slideDown();
});
$("#warning a").bind('click', function() {
$("#warning").slideUp();
return false;
});
});
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-36251023-1']);
_gaq.push(['_setDomainName', 'jqueryscript.net']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();