|
Q849 Can I create a version of the mouse hover code that works on both Netscape Navigator 4 and Microsoft Internet Explorer 4?
irt.org | Knowledge Base | DHTML | Q849 [ previous next ]
Q849 Can I create a version of the mouse hover code that works on both Netscape Navigator 4 and Microsoft Internet Explorer 4?
Try the following:
<SCRIPT LANGUAGE="JavaScript"><!--
function high(what,text) {
changeContent(what,'<DIV STYLE="color:red;">' + text + '<\/DIV>');
}
function low(what,text) {
changeContent(what,text);
}
function changeContent(what,text) {
if (document.layers) {
what.document.open();
what.document.write(text);
what.document.close();
}
}
//--></SCRIPT>
<P>
<DIV onMouseOver="this.style.color='red'"
onMouseOut="this.style.color='black'">
<LAYER onMouseOver="high(this,'Move the mouse pointer over this text')"
onMouseOut="low(this,'Move the mouse pointer over this text')">
Move the mouse pointer over this text
</LAYER>
</DIV>
</P>
|
|
|
Copyright © 1996-2009 irt.org, All Rights Reserved.