Exit pop interfering with signup form
I'm using this script:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs...n.js"></script> <script type="text/javascript"> var popit = true; $(window).bind('beforeunload', function() { $('#overlay').show(); if(popit == true) { popit = false; return 'Would you like a free gift? Click "Stay on this page" or "Cancel" below to claim your free ebook download!'; } }); </script> <div id="overlay" style="background:#000; width:100%; height:100%; position:fixed; top:0; left:0; z-index:1000; display:none;"><iframe src="http://www.mysite/free-ebook.html" width="100%" height="500px" style="border:none;"></iframe></div>
Is there any way to tweak it so that it only does its thing when the visitor leaves by closing the tab, and not when the visitor leaves by filling in the signup form?
20+ Years Exp . . . . . . . . . . . . Email - CPA - PPL
"Opportunity is missed by most people because it is dressed in overalls and looks like work." Thomas Edison