|
-
Aug 3rd, 2001, 06:29 PM
#1
heres a switch
ok everybody knows that IE does things that NS doesn't. so I have a switch for ya. I have this script that makes popup tips on the mouse. know on the first page both works great, but when I go to another page IE gives an error but NS works great. here is the script and the bold is the error in IE.
the error is "skn is null or not an object"
Code:
<DIV ID="dek" CLASS="dek"></DIV>
<SCRIPT TYPE="text/javascript">
<!--
/*
Pop up information box II (Mike McGrath ([email protected], http://website.lineone.net/~mike_mcgrath))
Permission granted to Dynamicdrive.com to include script in archive
For this and 100's more DHTML scripts, visit http://dynamicdrive.com
*/
Xoffset=-40; // modify these values to ...
Yoffset= 20; // change the popup position.
var nav,old,iex=(document.all),yyy=-1000;
if(navigator.appName=="Netscape"){(document.layers)?nav=true:old=false;}
if(!old){
var skn=(nav)?document.dek:dek.style;
if(nav)document.captureEvents(Event.MOUSEMOVE);
document.onmousemove=get_mouse;
}
function poptip(msg,bak){
var content="<TABLE WIDTH=125 BORDER=1 BORDERCOLOR=black CELLPADDING=2 CELLSPACING=0 "+
"BGCOLOR="+bak+"><TD align=center><FONT COLOR=black SIZE=2>"+msg+"</FONT></TD></TABLE>";
if(old){alert(msg);return;}
else{yyy=Yoffset;
if(nav){skn.document.write(content);skn.document.close();skn.visibility="visible"}
if(iex){document.all("dek").innerHTML=content;skn.visibility="visible"}
}
}
function get_mouse(e){
var x=(nav)?e.pageX:event.x+document.body.scrollLeft;skn.left=x+Xoffset;
var y=(nav)?e.pageY:event.y+document.body.scrollTop;skn.top=y+yyy;
}
function kill(){
if(!old){yyy=-1000;skn.visibility="hidden";}
}
//-->
</SCRIPT>
the only different is that on the other page I have another menu tha tis the same on the first. but the other page has 2 of them.
any Ideas??
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|