0

I found this nifty popup window JavaScript code that I like over at How to Auto Popup a CSS3 Modal Window When Page Loads?

Problem is that I want the user to simply click away from the box and that would cause it to close.

I tired to use self.close () from http://www.javascript-coder.com/window-popup/javascript-window-close.phtml but I cant figure out how to apply to everything else around the box. So when the users clicks anything outside the box it will close the popup.

Along with that I want to make sure that when the user closes the popup that it does not return during their php session. So basically unless they close their browser and bring it up again it will remain closed.

Community
  • 1
  • 1
Cesar Bielich
  • 4,754
  • 9
  • 39
  • 81
  • 1
    First part: http://stackoverflow.com/questions/152975/how-to-detect-a-click-outside-an-element Second part: http://stackoverflow.com/questions/1783302/clear-cookies-on-browser-close – Marc Kline Apr 06 '14 at 05:02
  • ok saw the first link and instead of using the `click` event I want to apply the onload event. I need it to load when the page loads. I applied the `ready` event but that seems to not work – Cesar Bielich Apr 06 '14 at 05:27
  • This is a modification of the original prototype posted for this modal type you're patterning from: http://dabblet.com/gist/10018953 Specifically, take a look at the JS tab to see how the click stuff works. I had to hack jQuery support into that code editor, so I added spacing and commented the code that should be relevant to you. – Marc Kline Apr 07 '14 at 11:56

0 Answers0