Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

CSS "Popup Window" (See related posts)

// Example of a css based "popup window"

	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>


Comments on this post

okcowt posts on Oct 19, 2007 at 22:04
This is cool...how can i add a timer so it goes away
Remaei posts on Mar 15, 2010 at 15:45
Tracy, am gonna buy you beer for this script !!! definitely BEST BEST way to call hidden DIV! Today i was spend allmost 10hours searching fot that and everybody was posting how to show/hide DIV using javascript!!! damn man! i dont want to use javascript! So if anybody read that! dont lose your time searching it! just use this code that Tracy was post!!!

THANKS AGAIN!!!!!!!!!!!!!!!!!

You need to create an account or log in to post comments to this site.