/    Sign up×
Community /Pin to ProfileBookmark

little window on mouse over

I’m not sure what to look up to find what I’m looking for…

What I need it when you have a word or something and you mouse over a word a little box shows up with writing… You see them sometimes when you are reading an article and they have a word that need a definition… You would mouse over and then the definition would show up…. If anyone understands what I mean and knows what its called so I can look it up or where to find one could you let me know…

Thanks

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@LeruraNov 07.2005 — it's the title-attribute that does that.

try this.[CODE]<span title="description">word</span>[/CODE]
Copy linkTweet thisAlerts:
@BaptistKittyauthorNov 07.2005 — hmmm... that might work but its not quite it...

the one I had seen was a little more complex looking... it was a script and sometimes would have a picture and text and such show up on mouseover
Copy linkTweet thisAlerts:
@AncoraNov 07.2005 — It it commonly called a "tooltip."

[CODE]<html>
<head>
<script type="text/javascript">

var midScreen = screen.width/2;
var tipContainer1 = "";

function stayHome(m){

if (document.all)
{
var currX = event.clientX;
var currY = event.clientY;
}
else {
var currX = m.pageX;
var currY = m.pageY;
}
if (!document.body.scrollTop)
{
var iL = document.documentElement.scrollLeft;
var iV = document.documentElement.scrollTop;
}
else {
var iL = document.body.scrollLeft;
var iV = document.body.scrollTop;
}
if (currX > midScreen-30)
{
var msgWidth = tipContainer1.clientWidth;
if (document.all){tipContainer1.style.left = (currX-msgWidth-10+iL)+'px'}
else {tipContainer1.style.left = (currX-msgWidth-10)+'px'}
}
else {
if (document.all){tipContainer1.style.left = (currX+10+iL)+'px'}
else {tipContainer1.style.left = (currX+10)+'px'}
}
if (document.all){tipContainer1.style.top = (currY+iV)+'px'}
else {tipContainer1.style.top = currY+'px'}
}

document.onmousemove = stayHome;

function insertFloatMsg(){

styleStr = "<style>.msgFloat {Position:Absolute;Top:0;Left:0;Border-Style:Solid;Border-Width:1px;Background-Color:Yellow;Padding-Right:5px;Padding-Left:5px;Padding-Top:3px;Padding-Bottom:3px;Font-family:Tahoma;Font-Size:13pt;Line-Height:102%;}</Style>";
divStr = "<div class='msgFloat' id='isFloat1'>&nbsp</div>"
document.write(styleStr);
document.write(divStr);
tipContainer1 = document.getElementById('isFloat1');
}

function hideMessage(){

tipContainer1.style.display = 'none';
while (tipContainer1.lastChild)
{tipContainer1.removeChild(tipContainer1.lastChild)}
}

function showMessage(toolTip,currItem){

var tipTxt = toolTip.split("|");
tipContainer1.style.display = 'inline';
for (i=0; i<tipTxt.length; i++)
{
tipContainer1.appendChild(document.createTextNode(tipTxt[i]))
tipContainer1.appendChild(document.createElement('br'))
}
currItem.onmouseout=hideMessage;
}

function initToolTip(){

insertFloatMsg();
hideMessage();
if (!document.all){document.captureEvents(Event.mousemove)}
}

</script>
</head>
<body>
<center>
<span onmouseover="showMessage('This is a message for the first link',this)" style='cursor:default'>This is some text</span>
<br><br>
<span onmouseover="showMessage('This is a message|for the second link|consisting of 3 lines',this)" style='cursor:default'>This is some more text</span>
</center>
<!-- Keep the following line immediately preceding the closing Body tag -->
<script type="text/javascript"> initToolTip() </Script>
</body>
</html>[/CODE]
Copy linkTweet thisAlerts:
@BaptistKittyauthorNov 07.2005 — yeah, thats it... thanks!!!
Copy linkTweet thisAlerts:
@slimjimJun 24.2006 — How would you use that but also add different images plus text.

So if i had a table with links that are taken from database and each link would have a different image in tooltip and the image name comes from the database also ?
×

Success!

Help @BaptistKitty spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...