473,411 Members | 1,975 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

Mouse events within a DIV layer and Netscape/Mozilla

I am trying to capture mouse events when entering and leaving a DIV
layer. This test code works fine with IE 6.0 and Opera 7.21 but fails
with Mozilla/Netscape. The strange thing is that the mouse events
respond continuously whenever the mouse is moving inside the DIV area.

Does anybody have a clue about what is happenning ?

J2G
==== TEST CODE ====

<html>
<head>
<script type=text/javascript>
function show() {
nbIn=0;
nbOut=0;
document.getElementById('AREA').style.visibility = 'visible';
}

function areaIn() {
nbIn++;
window.status = "out: " + nbOut + " in: " + nbIn;
}

function areaOut() {
nbOut++;
window.status = "out: " + nbOut + " in: " + nbIn;
}

</script>
</head>
<body>

<a href="javascript:show()">SHOW DIV</a>
<p>

<div id="AREA" size=5 style="visibility: hidden"
onmouseover="javascript:areaIn()" onmouseout="javascript:areaOut()">
<select size=5>
<option>value01
<option>value02
<option>value03
<option>value04
<option>value05
<option>value06
</select>
</div>

</body>
</html>
Jul 20 '05 #1
1 9714


Jean-Gael GRICOURT wrote:
I am trying to capture mouse events when entering and leaving a DIV
layer. This test code works fine with IE 6.0 and Opera 7.21 but fails
with Mozilla/Netscape. The strange thing is that the mouse events
respond continuously whenever the mouse is moving inside the DIV area.

Does anybody have a clue about what is happenning ?
Yes, the events mouseout/mouseover fire whenever the mouse moves
over/out any element, your div has a child element, the <select>, which
has child elements, the <option> elements, and when you move your mouse
over the select element then mouseout for the <div> is fired and
mouseover for the <select>. And events bubble, so any events happening
on the <select> or the <option> bubble up to the <div> and fire your
onmouseover/onmouseout handler. See
http://www.faqts.com/knowledge_base/...d/1606/fid/145
for a solution.
<div id="AREA" size=5 style="visibility: hidden"
onmouseover="javascript:areaIn()" onmouseout="javascript:areaOut()">
<select size=5>
<option>value01
<option>value02
<option>value03
<option>value04
<option>value05
<option>value06
</select>
</div>


--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jawahar Rajan | last post by:
All, I have a printer friendly page that is opened when a user clicks a link on my page to get the printer friendly version, How ever when they close out the printer friendly version and return to...
7
by: Eqbal Z | last post by:
Hi, I have the following code, and onmouseover/onmouseout etc. does not work in netscape 4.7. <div id="divUpControl"><a href="javascript:void(0);" onMouseOver="PerformScroll(-7);"...
9
by: punkin | last post by:
I am trying to catch mouse position on the entire screen by dynamically generating mouse click event at every 100 ms. My code only works for IEs but not any Netscape or Gecko-based browsers. The...
2
by: Catherine Lynn Smith | last post by:
I have been playing with a page design that would use a 'circular' area in the middle rather than the standard boring square box world of tables and frames. I have the design itself layed out...
7
by: Larry R Harrison Jr | last post by:
I am looking for javascript and a basic tutorial on how to make mouse-over drop-down menus--the type that when you "hover" over a subject links relevant to that subject "emerge" which you can then...
4
by: Jonas | last post by:
Hi! I have a web page where I want to intercept keypress events in an INPUT-tag and check if it is the Enter key, which calls another function that executes a search. My code runs on Netscape 7...
10
by: Danny | last post by:
How can I get the coordinates of the mouse cursor in Mozilla browsers as well as Opera and IE6? I'm struggling to understand how to capture mouse movement events with Mozilla/Netscape/Firefox and...
4
by: Jay | last post by:
Hi, How can I capture mouse position on Image? I found number of script capturing mouse position of the page. But I could not find anything based on image. What I want to find out is X Y...
3
by: Nick Wedd | last post by:
I have this <DIV id="canopy" onClick="myhandler(event.x,event.y); return false;"> <IMG border=0 height=66 width=292 src="gifs/top.gif"> </DIV> which works in IE. myhandler gets called with the...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.