By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 943 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

Why does this script work with IE and not with Firefox ?

P: n/a

Hi, there.

The following javascript is working perfectly with IE, but does not
work with Firefox (no error, but displays nothing).
Can somebody help ?
Thanks in advance,
Ben.
The script :

Xoffset=-60;
Yoffset=20;

var nav,old,iex=(document.all),yyy=-1000;
if(navigator.appName=="Netscape"){(document.layers )?nav=true:old=true;}

if(!old){
var skn=(nav)?document.dek:dek.style;
if(nav)document.captureEvents(Event.MOUSEMOVE);
document.onmousemove=get_mouse;
}

function show_popup(msg1,msg2){
var content="<TABLE WIDTH=150 BORDER=1 BORDERCOLOR=black CELLPADDING=2
CELLSPACING=0 BGCOLOR='#999999'><TD ALIGN=center><FONT COLOR=white
SIZE=3><I>"+msg1+"</I></FONT><BR><FONT COLOR=white
SIZE=2><I>"+msg2+"</I></FONT></TD></TABLE>";
if(old){alert(msg);return;}
else{yyy=Yoffset;

if(nav){skn.document.write(content);skn.document.c lose();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;s kn.left=x+Xoffset;
var y=(nav)?e.pageY:event.y+document.body.scrollTop;sk n.top=y+yyy;
}

function kill_popup(){
if(!old){yyy=-1000;skn.visibility="hidden";}
}

and the calling Html :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1">
<TITLE>untitled</TITLE>
</HEAD>

<BODY BGCOLOR="#999999" LINK="#0000FF" VLINK="#0000FF" ALINK="#0000FF">
<SCRIPT LANGUAGE="javascript" src="../html/popup.js"></SCRIPT>

<BR><BR><P ALIGN="CENTER"><FONT SIZE="8" COLOR="#336666">Photos en
Couleurs</FONT></P><BR><BR>
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" ALIGN="CENTER"
WIDTH="650">
<TR>
<TD ALIGN="CENTER"><A HREF="c_fleurs/c_fleurs.htm"><IMG
SRC="c_fleurs/01s.jpg" BORDER="0"
onMouseOver="show_popup('Fleurs','14.3.2005')";
onMouseOut="kill_popup()"></A></TD>
</TR>
</TABLE>
</BODY>
</HTML>

Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
be************@yahoo.fr wrote:
The following javascript is working perfectly with IE, but does not
work with Firefox

iex=(document.all)
if(navigator.appName=="Netscape"){(document.layers )


http://www.mozilla.org/docs/web-deve...ade_2.html#dom

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #2

P: n/a

OK, thanks !

Ben.

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.