Hi, I need to exit popups written that I can plug into any webpage, but they are not like exit popups you are used to. The first is not really an exit popup, it is an iFrame that appears as the user goes to move the cursor to the top of the screen (as they would do when leaving the page). The second is to happen "onbeforeunload". Again, this is not really an exit popup, because I would like a system message to appear, but also for the URL to change at the same time. Please look at the detailed specs.
There are 2 parts to this project. I need to be able to plug in the code that you write into many pages. I will do this. Also, both the parts would need to be able to work on the same page. PART 1 ------- The first is the iFrame part. As the user moves the mouse up to the top of the browser (at they go to leave), I would like an iFrame to appear in the middle of the screen, and the rest of the screen to be darkened. It shouldn't matter how far down the user has scrolled on the page, the frame still needs to appear, and it still needs to appear in the center of the viewable area (ie. They shouldn't need to scroll up to see the iFrame). This also needs to work on pages that have embeded YouTube videos on them, and the iFrame must appear on top of the video. It should be easy for me to set the size of the frame (it's ok if i need to change code) and what page it displays. For now, the frame can just display google. It needs to work in IE6, IE7, IE8, FF2, FF3, Safari. Please also provide for me the code required to close the frame. PART 2 ------- The second part should happen as the user goes to leave the page. This may be by the "back" button, closing the tab, etc. I think you would use the "onbeforeunload" event, but i am open to suggestions. When the user goes to leave the page, they should see a system generated message, and also the page in the background should change to a new URL (this can be yahoo for now) There are some events that might happen (for example, they click the "buy" button) where by nothing should happen (ie. no system message, and no changing the URL). This would also need to work when there is a video on the original page.