472,958 Members | 2,202 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Firefox/Javascript bug?

I just noticed that in FireFox, onmouseover and onmouseout events do not work properly when a div's overflow is set to hidden/auto/scroll. If you click and hold inside the div with onmouseover/out listeners and move the mouse away, the events won't launch (they do launch properly in IE7, haven't tested other browsers). If the div has overfloe:visible, the events fire as expected.

I'll provide a working testcase:
Expand|Select|Wrap|Line Numbers
  1. <html>
  2.     <head>
  3.         <script type="text/javascript">
  4.             function showMouseOverDivStatus ( mouseOverDiv ){
  5.                 var mouseOverDivStatus       = window.document.getElementById("mouseOverDivStatus");
  6.                 mouseOverDivStatus.innerHTML = mouseOverDiv;
  7.             }
  8.             function setInnerDivOverflow( newOverflow ){
  9.                 var innerDiv = document.getElementById("innerDiv");
  10.                 innerDiv.style.overflow = newOverflow;
  11.             }
  12.         </script>
  13.     </head>
  14.     <body>
  15.         Mouse over inner div: <span id="mouseOverDivStatus">false</span>
  16.         <div style="background:red; height:200px; width:200px">
  17.             <div 
  18.                 id="innerDiv" 
  19.                 style="position:absolute;top:50px;left:50px;background:yellow;height:100px;width:100px;"
  20.                 onmouseover="showMouseOverDivStatus('true');" 
  21.                 onmouseout="showMouseOverDivStatus('false');"
  22.             >
  23.                 Hold left click inside yellow area and move mouse away.
  24.             </div>
  25.         </div>
  26.         <input type="button" value="Visible Overflow" onclick="setInnerDivOverflow('visible');" /><br>
  27.         <input type="button" value="Scroll Overflow"  onclick="setInnerDivOverflow('scroll');"  /><br>
  28.         <input type="button" value="Hidden Overflow"  onclick="setInnerDivOverflow('hidden');"  /><br>
  29.         <input type="button" value="Auto Overflow"    onclick="setInnerDivOverflow('auto');"    /><br>       
  30.     </body>
  31. </html>
  32.  
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3

Am I missing something here?
Apr 19 '07 #1
6 2089
Also, can anyone think of a workaround for this issue? I've tried a few things unsuccessfully.
Apr 19 '07 #2
mrhoo
428 256MB
One man's bug is another man's feature.

I suspect you are more familiar with IE than firefox-
this has to do with the way the two browsers handle
selecting text.

If you hold the mouse down before you enter the innerDiv,
the behavior as you continue to move the mouse will be as you expect.

Or if you make a selection inside the innerDiv and then move the mouse around with the button down,the behavior will be as you expect.

This should give a clue as to what you need to do to make firefox behave like
IE- I prefer the reverse, myself.
Apr 20 '07 #3
One man's bug is another man's feature.
I suspect you are more familiar with IE than firefox.
Nope, not at all.

If you hold the mouse down before you enter the innerDiv,
the behavior as you continue to move the mouse will be as you expect.

Or if you make a selection inside the innerDiv and then move the mouse around with the button down,the behavior will be as you expect.

This should give a clue as to what you need to do to make firefox behave like
IE- I prefer the reverse, myself.
But why does it behave differently depending on the overflow of the inner div?

Also, I looked around mozilla's bugzilla and found this little devil: https://bugzilla.mozilla.org/show_bug.cgi?id=357679
yup, my find was just a particular case of a bigger firefox bug, I still don't know how can it be seen as a feature by any man :P
Apr 20 '07 #4
drhowarddrfine
7,435 Expert 4TB
Unless I misread it, the "same as" bug report says this is how it's supposed to work.
Apr 20 '07 #5
Unless I misread it, the "same as" bug report says this is how it's supposed to work.
Why should events work in a completely different way depending on a div's overflow property?
Apr 20 '07 #6
before this:
FF: 4563465
IE: 3

after this:
FF: 4563465
IE: 4

Congrats :)
Apr 23 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: Howard Kaikow | last post by:
Yesterday, I decided to try Firefox. I've encountered a behavior that is either a bug in Firefox or a bug in my Javascript code. I'll try to explain the problem, hoping that this newsgroup can...
2
by: Stewart | last post by:
Originally posted in comp.lang.javascript: Newsgroups: comp.lang.javascript From: "Stewart" Date: 23 Aug 2005 02:50:04 -0700 Local: Tues, Aug 23 2005 10:50 am Subject: FireFox, RemoveChild,...
3
by: niconedz | last post by:
Hi The following code works fine in IE but not Firefox. It's a little script that zooms an image and resizes the window to fit. Can anybody tell me what's wrong? Thanks Nico == btw.....
45
by: Pat | last post by:
its seems asp.net validation doesn't fire when using FireFox? Tested a page and it doesn't fire. It seems the javascript doesn't fire Any ideas?
6
by: Mark Olbert | last post by:
The doPostBack javascript functioning is not submitting the page when called by linkbuttons (or an autopostback checkbox, for that matter). I'm aware of a problem with Netscape browsers and the...
4
by: petermichaux | last post by:
Hi, I'm hoping for a reason I'm wrong or an alternate solution... I'd like to be able to dynamically include some javascript files. This is like scriptaculous.js library but their solution is...
4
by: lmarceglia | last post by:
Hi, I have this website that doesn't work in Firefox 1.5: www.pianetaluca.com The HTML source is: <TITLE>PianetaLuca</TITLE> </HEAD>
11
by: minnesotti | last post by:
Hi there, I subscribed to a photographic pictures-hosting website which is heavy on JavaScript. My preferred latest browser Mozilla Firefox does not work with it -- no pictures are displayed and...
8
by: Matt Kruse | last post by:
http://news.zdnet.com/2100-1009_22-6121608.html Hackers claim zero-day flaw in Firefox 09 / 30 / 06 | By Joris Evers SAN DIEGO--The open-source Firefox Web browser is critically flawed in...
3
by: SAL | last post by:
Hello, I did google this issue and found some stuff related to BrowserCaps section of either web.config or machine.config but it didn't work. It seems that most pages in my webapp are okay but a...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

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.