Zombay Posted March 14, 2011 Share Posted March 14, 2011 Hi! I found this easy script from: http://codesnippets.joyent.com/posts/show/708 Click <a onmouseover='this.style.cursor="pointer" ' onfocus='this.blur();' onclick="document.getElementById('PopUp').style.display = 'block' " ><span style="text-decoration: underline;">here</span></a> <div id='PopUp' style='display: none; position: absolute; left: 50px; top: 50px; border: solid black 1px; padding: 10px; background-color: rgb(255,255,225); text-align: justify; font-size: 12px; width: 135px;'> This is a CSS Popup that can be positioned anywhere you want on the page and can contain any test and images you want. <br /> <div style='text-align: right;'><a onmouseover='this.style.cursor="pointer" ' style='font-size: 12px;' onfocus='this.blur();' onclick="document.getElementById('PopUp').style.display = 'none' " ><span style="text-decoration: underline;">Close</span></a></div> </div> The idea is old; div's display is changed by javasrcipt ´none´ to ´block´... I would like to use this at my site in many cases and I was woundering what would be the best solution to load content in ´PopUp´ -div AFTER user have pressed ´Click´ and opened "Popup Window"? With iframe maybe or javascript somehow? Quote Link to comment https://forums.phpfreaks.com/topic/230589-css-popup-window-how-to-load-content-after-user-have-opened-window/ Share on other sites More sharing options...
Adam Posted March 15, 2011 Share Posted March 15, 2011 I'd say it depends really. Will the text be static, or is it dynamically generating from a DB / some other source? How many different instances of the pop-up will be on each page? etc. Quote Link to comment https://forums.phpfreaks.com/topic/230589-css-popup-window-how-to-load-content-after-user-have-opened-window/#findComment-1187711 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.