View Full Version : onmouseover in NS4...what tags does it work in??
ChuckRW
11-21-2002, 04:18 PM
Hi,
I am calling some functions useing onmouseover and onmouseout. In EI and in NS7 i can use them in img, span, anchor, and div tags but in NS4 it only works from the anchor tag. It would be my easiest solution if I could nest the tags containing the onmouseovers and outs.... but I'm sure I can't do that with anchor tags.
Are there any tags , nestable or not, that I can use an onmouseover in, besides the anchor tag, in NS4?
Thanks for your time.
Chuck
ShriekForth
11-21-2002, 09:52 PM
It's been a while since I looked at it, but it will also work in an the IMG tag.. Other than that I think you are out of luck.
ShriekForth
requestcode
11-21-2002, 11:56 PM
NS4.7 does not support the onMouseOver and onMouseOut events on the img tag and the others you mentioned. For the divs what I have resorted to is placing a script within the divs that has the onMouseOver and onMouseOut events like this:
<DIV ID="link0div" onmouseover="droplink('link0div','linka')" onmouseout="hidemenu('link0div')" style="position:absolute;left:0;top:0;width:90;height:49;visibility:hidden;layer-background-color:lightgreen;background-color:lightgreen;border:1px solid black;padding:0px;">
<script language="JavaScript">
for (i=0;i<slink0.length;i++)
{
document.write("<center>"+slink0[i]+"</center>")
}
/* Below for Netscape 4.0+ only */
function onMouseOver() {droplink('link0div','linka');}
function onMouseOut() {hidemenu('link0div');}
</SCRIPT>
</div>
IE and NS6+ do not support these so they don't cause any problems with them. Hope this helps.
ChuckRW
11-22-2002, 07:02 AM
Thanks guys.
requestcode, let me see if I understand correctly....
You call the function droplink, this makes link0div visible at which point the 2 functions you created in the script run???
Yes? No? If so, how is the initial onmouseover triggered from a hidden div?
Am I totally lost?
--Chuck
Here's an example of onmouseover/out working on an image in NS4
http://www.javascript-fx.com/post/imgswap/
brothercake
11-22-2002, 04:28 PM
Any event will work on any tag in netscape 4.
But only anchors have native support; for others you need to set up an event listener using document.captureEvents
ChuckRW
11-23-2002, 03:03 AM
Thanks guys.
I've got my solution working useing anchor tags and I'm already onto another unrelated problem.
But, Brothercake, I am interested in the event listeners. Could you point me to some intermediate-level reading on the suject?
Thanks,
Chuck
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.