This is an example page of an exit popup

Try and leave the page, when your cursor passes 5 pixels from the top, a modal window will popup prompting the user with an offer, such as 'Purchase Now and get $10 off' or 'Hold on, make sure to sign-up for our newsletter before you go'. You get the idea :)

<script type="text/javascript"> $(document).ready(function() { $(document).mousemove(function(e) { $('#exitpopup').css('left', (window.innerWidth/2 - $('#exitpopup').width()/2)); $('#exitpopup').css('top', (window.innerHeight/2 - $('#exitpopup').height()/2)); if(e.pageY <= 5) { // Show the exit popup $('#exitpopup_bg').fadeIn(); $('#exitpopup').fadeIn(); } }); $('#exitpopup_bg').click(function(){ $('#exitpopup_bg').fadeOut(); $('#exitpopup').slideUp(); }); }); </script> <style type="text/css"> #exitpopup { text-align:center; } #exitpopup h1 { margin-top:0px; padding-top:0px; } #exitpopup p { text-align:left; } </style> <div style="display: none; width:100%; height:100%; position:fixed; background:#000000; opacity: .8; filter:alpha(opacity=0.8); z-index:999998;" id="exitpopup_bg"> </div> <div style="width:670px; height:450px; margin:0px auto; display:none; position:fixed; color:#ffffff; padding:20px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; z-index:999999; background:rgb(20, 20, 20); background:rgba(0, 0, 0, 0.8);" id="exitpopup"> <h1>Wait!!! Before you go...</h1> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis aliquam interdum enim ut congue. Vivamus erat velit, convallis nec suscipit at, egestas nec nunc. Phasellus in faucibus nunc. Curabitur luctus suscipit faucibus. Phasellus risus risus, bibendum vitae commodo at, gravida in lorem. Nam euismod, turpis non viverra eleifend, leo lorem tempor elit, sit amet hendrerit justo purus at magna. In hac habitasse platea dictumst. Integer sodales pretium libero sed mattis. Aenean suscipit neque ac purus tincidunt iaculis.<br /><br /> Pellentesque ultricies tellus eu orci tempor aliquam vel posuere orci. Nulla in sapien ut tellus malesuada vulputate. Nunc sit amet enim felis, sit amet semper sapien. Vestibulum commodo, nisi vitae faucibus ullamcorper, libero est varius lorem, vel euismod ipsum odio sed elit. Sed risus enim, viverra sit amet pharetra molestie, scelerisque nec tortor.</p> <a href="#"><img src="letmeinnow.png" style="width:568px; height:190px" border="0" style="border:0px; margin:0px auto;" /></a> </div>