Here's what I've come up with so far. I just need a way to capture the page they were about to go to. At first, I thought what I've done thus far was impossible, but it's not. So, I'm not giving up on this just yet. By the way, I got rid of the drop-in JS, and replaced it with a simple showDiv function to clean up the code, since that's not what I'm having a problem with.
HTML Code:
<html>
<head>
<style>#dropInDiv { border:1px solid #000; background:#ddd; position:absolute; top:200px; left:200px; display:none;}</style>
<script>
function showDropIn(divName){
document.getElementById(divName).style.display='block';
}
function leaveSite() {
//this is what I'm missing!
}
</script>
</head>
<body onbeforeunload="showDropIn('dropInDiv')" onunload="document.execCommand('Stop');">
<div id="dropInDiv">
<p>wait dont leave!</p>
<p>take an additional 10% off now.</p>
<ul>
<li><a href="fakelink.htm">Give me 10%off</a></li>
<li><a href="javascript:leaveSite();">Just let me leave already!!!</a></li>
</ul>
</div>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris dolor. Nullam blandit tristique dui. Proin venenatis mattis arcu. Suspendisse potenti. Integer placerat nisl sit amet erat. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Quisque fringilla lorem eget mauris. Nunc fermentum pellentesque leo. Proin orci orci, sollicitudin vel, iaculis et, facilisis eu, justo. Nunc libero quam, ornare a, vestibulum id, rutrum eget, dolor.</p>
</body>
</html>
Thanks for having a look, Much appreciated.
Bookmarks