Closed Bug 118749 Opened 24 years ago Closed 24 years ago

Cannot fire the onmouseover event on another object

Categories

(Core :: DOM: Core & HTML, defect)

x86
All
defect
Not set
minor

Tracking

()

RESOLVED INVALID

People

(Reporter: shurd, Assigned: jst)

References

()

Details

From Bugzilla Helper: User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98) BuildID: 2001101117 object.onmouseover() doesn't fire the onMouseOver even for the object. The URL workins in Netscape 4.x and IE5+ (Not tested with 4.x) Basically, <div name="blam1" id="blam1" onMouseOut="this.style.backgroundColor='000099'" onMouseOver="this.style.backgroundColor='007fff'" style="z-index: 1; position: absolute; top: 15; left: 10; width: 102; height: 52; background-color: 000099"></div> With an image over it that has the imagemap bit: <area href="blah3.html" shape=rect coords="0,0,102,51" onMouseOver="blam1.onmouseover()" onMouseOut="blam1.onmouseout()"> The mouseover on the area is fired, but will not call the onMouseOver for the div tag. Reproducible: Always Steps to Reproduce: 1. Go to http://tw2.thebbs.org/blam3.html 2. Move mouse over one of the Blam buttons 3. Compare to behaviour in IE or NS 4.x Actual Results: Nothing. :-) Expected Results: Background color of the underlying DIV tag should change The imagemap areas still work, so there's no real loss of function... it just puts Mozilla on par with Opera and Konquerer for the page. :-)
Confirming on WinNT, Linux. OS: Win98 ---> All. In the JavaScript Console, we're getting errors like: Error: blam1 is not defined Error: blam2 is not defined etc. NOTE: the source code at the above site uses <LAYER> elements with names = "blam1", "blam2", etc. and <DIVS> these as ids: <div id="blam1" <div id="blam2" <div id="blam3" etc. <layer name="blam1" <layer name="blam2" <layer name="blam3" etc. QUESTION 1 In the <AREA> element, is it correct in Mozilla to do onMouseOver="blam1.onmouseover()" ? How is Mozilla going to resolve |blam1| as a name? If you replace this code with: onMouseOver="alert(typeof blam1);" in Mozilla, you get "undefined". In NN4.7 you get "object". QUESTION 2 In Mozilla, is the mouseover property of a DOM element accessible and callable, as it is in NN4.7? These are DOM questions, not JS Engine. Reassigning to DOM Level 0 -
Assignee: rogerl → jst
Status: UNCONFIRMED → NEW
Component: Javascript Engine → DOM Level 0
Ever confirmed: true
OS: Windows 98 → All
QA Contact: pschwartau → desale
Answer to the first question: that won't work, you can't reference a div with id "foo" using document.foo or window.foo. NS4 allows the former (with layers) and I think IE allows it as well (with divs), though I'm not sure. In Mozilla it won't work. Second question: I don't know, but I've never seen any such thing before. I'll be glad to know the answer as well :)
Fabian is correct about question one, that just won't work in mozilla, use document.getElementById('foo') in stead of document.foo. As for question 2, yes, element.onmouseover is both settable, and gettable, and thus callable. Try this: <html> <body> <p onclick="document.getElementsByTagName('p')[1].onmouseover();">foo</p> <p onmouseover="alert('onmouseover');">bar</p> </body> </html> Marking INVALID.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.