Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

alt/acronym tag display duration 1

Status
Not open for further replies.

DeepBlerg

Technical User
Jan 13, 2001
224
AU
Any ideas how to keep the alt or acronym tags popup indefinately until the user rolls off them rather than have them popup and disappear after 5 seconds.

Thanks.
 
I don't know how to do that, but you can use layers to do it instead. Here is a script I wrote to do something like that, it moves as well, but change onMousemove to onMouseover to make it static.
It doesn't look like I made it particularly cross-browser so it made need a bit of work to make it Netscape compatible if you want to bother.

Anyway, hope it helps a bit.

Code:
<html>
<head>
<script>
function ToolTip(what){
		 what=eval(what);
		 what.style.display='block';
		 what.style.left=event.x+10+document.body.scrollLeft;
		 what.style.top=event.y+document.body.scrollTop;
}
function UnToolTip(what){
		 what=eval(what);
		 what.style.display='none';
}		 
</script>			
<style>
/* defines style for tooltip script, editable*/
.menudiv{
		 width:150;
		 background-color:#ddddff;
		 border-width:1;
		 border-style:solid;
		 border-color:#000080;
		 font-family:Tahoma;
		 font-weight:bold;
		 font-color:red;
		 font-size:11px;
		 padding:5;
/* leave rest of style alone */
   		 display:none;
   		 position:absolute;
 		 height:10;
}		 		 
</style>

</head>

<body>
<!-- Create actual ToolTip layers here -->
<div id=&quot;test&quot; class=&quot;menudiv&quot;>Just testing</div>
<div id=&quot;test2&quot; class=&quot;menudiv&quot;>Testing again, but with more text so it goes on multiple lines automatically</div>
<div id=&quot;buttons&quot; class=&quot;menudiv&quot;>Works on buttons too</div>
<div id=&quot;withbutton&quot; class=&quot;menudiv&quot;><img src=&quot;another.jpg&quot;></div>
<div id=&quot;withbuttonandtext&quot; class=&quot;menudiv&quot;><img src=&quot;another.jpg&quot;><bR>Some text with the picture</div>
<!-- End of ToolTip layers -->

<a href=&quot;#&quot; onMouseMove=&quot;ToolTip('test');&quot; onMouseOut=&quot;UnToolTip('test');&quot;>Mouseover me!</a><br>
<a href=&quot;#&quot; onMouseMove=&quot;ToolTip('test2');&quot; onMouseOut=&quot;UnToolTip('test2');&quot;>Me too!</a><br>
<a href=&quot;#&quot; onMouseMove=&quot;ToolTip('buttons');&quot; onMouseOut=&quot;UnToolTip('buttons');&quot;><img src=&quot;button1.jpg&quot;></a><bR>
<a href=&quot;#&quot; onMouseMove=&quot;ToolTip('withbutton');&quot; onMouseOut=&quot;UnToolTip('withbutton');&quot;>Images can be in ToolTip too!</a><br>
<a href=&quot;#&quot; onMouseMove=&quot;ToolTip('withbuttonandtext');&quot; onMouseOut=&quot;UnToolTip('withbuttonandtext');&quot;>Or images and text</a><br>
</body>
</html>

Hope I helped / Thanks for helping
if ((Math.abs(x)<10&&Math.abs(y)<10) && (((parseInt(Math.abs(x).toString()+Math.abs(y).toString())-Math.abs(x)-Math.abs(y))%9)!=0)) {alert(&quot;I'm a monkey's uncle&quot;);}
 
Hi all,
Just looking back on this tool tip code and it works well, however, does this work with image maps? I want to get the tool tip pop-ups to work with an image map but I've not been able to do so with the above code.
Thanx :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top