...

View Full Version : How do you?



ragol_67
09-28-2002, 03:42 PM
How do you make that yellow box pop up when you move your mouse over a link?

I think it has something to do with ALT="text" but I can't figure out how to make it work!

Please help.

Mr J
09-28-2002, 04:16 PM
Have a play around with this




<SCRIPT language="JavaScript">
<!--
function showLayer(name) {
name.style.visibility = "visible";
}

function hideLayer(name) {
name.style.visibility = "hidden";
}
// -->
</SCRIPT>

<a href="null" onmouseout="hideLayer(thisone)" onmouseover="showLayer(thisone)">Mouseover this link</a>

<DIV id="thisone" style="position:relative;top:20; width:100; border:2 inset blue;background-color:gold;visibility: hidden; z-index: 1">Do You Mean Like This</div>

Nightfire
09-28-2002, 04:34 PM
<p title="This is text">Hello</p>

tommysphone
10-03-2002, 03:50 PM
See Dynamic drive for the code :) Works a treat.

Put this in the <a> tag

onMouseover="showtip(this,event,'Visit Dynamic Drive for DHTML Scripts!')" onMouseout="hidetip()"

Like so - <a href="http://dynamicdrive.com" onMouseover="showtip(this,event,'Visit Dynamic Drive for DHTML Scripts!')" onMouseout="hidetip()">Dynamic Drive</a>

and this script in the <head> tag

<script>
if (!document.layers&&!document.all)
event="test"
function showtip(current,e,text){

if (document.all){
thetitle=text.split('<br>')
if (thetitle.length>1){
thetitles=''
for (i=0;i<thetitle.length;i++)
thetitles+=thetitle[i]
current.title=thetitles
}
else
current.title=text
}

else if (document.layers){
document.tooltip.document.write('<layer bgColor="white" style="border:1px solid black;font-size:12px;">'+text+'</layer>')
document.tooltip.document.close()
document.tooltip.left=e.pageX+5
document.tooltip.top=e.pageY+5
document.tooltip.visibility="show"
}
}
function hidetip(){
if (document.layers)
document.tooltip.visibility="hidden"
}

</script>

I think thats it.

beetle
10-03-2002, 10:44 PM
ragol_67

Nightfire answered your question most directly. the title attribute is what creates this.

<a href="page.htm" title="Here is a link!">Click me!</a>

SYP}{ER
10-04-2002, 02:24 AM
Yeah, title is best. The alt="" attribute for images isn't even supposed to show the mouseover tooltip but IE does anyway. Mozilla won't show it.

On a side note, doesn't <img> have an "alt-src" attribute which displays the alt-src (image url) if the src cannot be found? I read about it somewhere but there's nothing about it at w3schools.com :confused:

beetle
10-04-2002, 02:28 AM
Uh, there's lowsrc and dynsrc that I know of...

adios
10-04-2002, 02:49 AM
ragol_67:

Kindly read 1) here:

http://www.codingforums.com/showthread.php?threadid=2090

zoobie
10-05-2002, 04:41 PM
If your site is to be indexed by search engines, make sure you use keywords/phrases in both the title for links and the alt for images.

<a href="page.html" title="Baseball stories">Baseball stories</a>

<img src="rose.jpg" alt="Baseball hit leader"></img> :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum