Forum Moderators: open

Message Too Old, No Replies

commentish popup

         

ofjurai

6:06 am on Feb 26, 2004 (gmt 0)

10+ Year Member



I'm trying to get a little comment box / tip box to pop up when someone moves their mouse over a certian image or piece of text.

But with the one I'm currently using (shown below) the popup wont move. It is in the same place on the page. Not where you onmouseover.
If someone can show my another script that does what I'm looking for, or show me how to edit this one, that would be great help.


<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function setupDescriptions() {
var x = navigator.appVersion;
y = x.substring(0,4);
if (y>=4) setVariables();
}
var x,y,a,b;
function setVariables(){
if (navigator.appName == "Netscape") {
h=".left=";
v=".top=";
dS="document.";
sD="";
}
else
{
h=".pixelLeft=";
v=".pixelTop=";
dS="";
sD=".style";
}
}
var isNav = (navigator.appName.indexOf("Netscape")!=-1);
function popLayer(a){
desc = "<table cellpadding=3 border=1 bgcolor=F7F7F7><td>";
if (a==1) desc += "1";
if (a==2) desc += "2";
desc += "</td></table>";
if(isNav) {
document.object1.document.write(desc);
document.object1.document.close();
document.object1.left=x+25;
document.object1.top=y;
}
else {
object1.innerHTML=desc;
eval(dS+"object1"+sD+h+(x+25));
eval(dS+"object1"+sD+v+y);
}
}
function hideLayer(a){
if(isNav) {
eval(document.object1.top=a);
}
else object1.innerHTML="";
}
function handlerMM(e){
x = (isNav)? e.pageX : event.clientX;
y = (isNav)? e.pageY : event.clientY;
}
if (isNav){
document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove = handlerMM;
// End -->
</SCRIPT>


<BODY OnLoad="setupDescriptions()">


<div id="object1" style="position:absolute; visibility:show; left:25px; top:-50px; z-index:2"></div>


<a href="something" onMouseOver="popLayer(1)" onMouseOut="hideLayer(-50)">something</a>

ofjurai

8:08 am on Feb 27, 2004 (gmt 0)

10+ Year Member



Someone helped me figure this out so this thread can be locked or whatever ya do here.
Thx