Jump to content

Help with a popup that pops down...?


hessdesigns
 Share

Recommended Posts

Hey all... Just joined up on the forums, and I'm a new Javascripter. Anyway, my boss has been asking me about incorporating a link to an informational item, similar to what you see in this link to Yahoo News. Specifically, he likes the link on "Tony Blair" in the first sentence. We're just selling printers; this doesn't need to be a search like Yahoo has. All he wants is for it to pop down and show a sale price and maybe a link to another part of the site. I'm just wondering: is there a simple way (a la "window.open") to make this happen, or is this going to require some extensive scripting? If it's a going to be extensive, no need to show scripting, because he also wants to keep the cost down. Thanks in advance for your help!

Link to comment
Share on other sites

Well I'd use a simple <div> for that. You'll probably get my point from this code:

<html>	<head>		<script type="text/javascript">		function showBox(obj)		{			document.getElementById("box").style.display = "inline";		}		function hideBox()		{			document.getElementById("box").style.display = "none";		}		</script>	</head>	<body>		<p onmouseover="showBox(this)" onmouseout="hideBox()" style="cursor: pointer;">When your mouse is over this...</p>		<div id="box" style="padding: 5px; border: 3px solid #9999FF; position: absolute; display: none; z-index: 10;">... it shows a box.</div>	</body></html>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...