...

View Full Version : Should be a simple question but I can't find an answer.



jrlstanford
01-26-2006, 06:25 AM
Hello,

I'm trying to make an information box pop up whenever the page is clicked in exactly the spot where the mouse is located but I can't find out anywhere how to do this. It just needs to be a square box with a border (not a full new window) that can display HTML. If someone could help me I'd greatly appreciate it.

Thanks very much.

vwphillips
01-26-2006, 11:05 AM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>
<title></title>
<script language="JavaScript" type="text/javascript">
<!--
function zxcWWHS(){
if (document.all){
zxcCur='hand';
zxcWH=document.documentElement.clientHeight;
zxcWW=document.documentElement.clientWidth;
zxcWS=document.documentElement.scrollTop;
if (zxcWH==0){
zxcWS=document.body.scrollTop;
zxcWH=document.body.clientHeight;
zxcWW=document.body.clientWidth;
}
}
else if (document.getElementById){
zxcCur='pointer';
zxcWH=window.innerHeight-15;
zxcWW=window.innerWidth-15;
zxcWS=window.pageYOffset;
}
zxcWC=Math.round(zxcWW/2);
return zxcWS;
}

function ShowMe(event){
if(!event) var event=window.event;
if (document.all){ zxcMseX=event.clientX; zxcMseY=event.clientY+zxcWWHS(); }
else {zxcMseX=event.pageX; zxcMseY=event.pageY; }
document.getElementById('fred').style.left=(zxcMseX)+'px';
document.getElementById('fred').style.top=(zxcMseY)+'px';
}

document.onmousedown=function(event){ ShowMe(event); }
//-->
</script>

</head>

<body>
<div id="fred" style="position:absolute;width:100px;height:100px;background-color:#FFFFCC;border:solid black 1px;" ></div>
<div id="fred" style="width:1px;height:1100px;" ></div>
</body>

</html>

search
http://www.vicsjavascripts.org.uk or google for ToolTip

jrlstanford
01-27-2006, 02:29 AM
Wow! Thanks so much...you've been so helpful. Great site too.

-Josh



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum