Help Needed With My jQuery & CSS Exit Popup Modal....

Help Needed With My jQuery & CSS Exit Popup Modal....

So I have this code, but it does NOT trigger the way that I would like it to. I'm new to learning jQuery (a month or two) so I'm still not 100% with understanding this code that I have.

The code is supposed to create an "exit popup" to help folks learn about my subscribers newsletter, but it doesn't open if you scroll down the page & then try to exit. It only fires off if you are at the top of the page & then try to move off to click on the exit tab.

I need the code to fire off even when the user has scrolled down the page, & preferably have it only fire off no more than 2 times in one session. I know that this would also require some kind of cookie install.

Anyhow, here is the current code that I'm working with:
  1. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
  2. <style type="text/css">
  3. body{
  4. margin:0px;
  5. padding:0px;
  6. font-family:'Helvetica Neue', Helvetica, Arial, Courier;
  7. text-align:center;
  8. }

  9. code{
  10. width:800px;
  11. display:block;
  12. white-space:pre;
  13. width:600px;
  14. }

  15. #exitpopup{
  16. text-align:center;
  17. }

  18. #exitpopup h1{
  19. margin-top:0px;
  20. padding-top:0px;
  21. }
  22. #exitpopup p{
  23. text-align:left;
  24. }

  25. </style>

Would appreciate the help with getting the code to popup regardless if the user is at the top of the page or bottom. Thanks in advance if you can offer any help.