473,799 Members | 2,786 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trouble Coding an Expanding Tree Menu -- onmouseout and target event different for IE and Gecko

So, I'm attempting to code an expanding tree menu, based off of
unordered lists containing unordered lists. I'm also trying to do it in
such a way that none of the javascript has to go inline with the
markup:

http://weston.canncentral.org/misc/w.../template.html

So far, so good. It seems to work in Gecko-based browsers rather well
(mouse-over "Online Services" to see it work).

However, in Internet Explorer, things are a bit different...

For one thing, it initially seemed that the "onmouseout " is not only
triggered by moving outside the LI element that contains the hidden
submenu, but also by moving onto any element which the LI contains. Not
particularly intuitive to me, but I figured I'd just code something
that tests whether the target element of the onmouseout event is a
child of the LI receiving it, and if so, keep the submenu visible, and
if not, hide it.

This helps things work under Safari (which apparently has a similar
event model), but IE still doesn't work. When I move the mouse within
the LI onto some other element contained by the LI, it seems to think
that the target element is the containing DIV (the one id'd as "nav").

Any idea what's going on here? I've been banging my head against this
for a few days...

Thanks,

Weston

Jul 23 '05 #1
2 1744
VK
You may want to read through this thread:
<http://groups-beta.google.com/group/comp.lang.javas cript/browse_frm/thread/083ed9630b81dee 9/cd81fab7ffdfadd 7#cd81fab7ffdfa dd7>

Come back if any more questions.

Jul 23 '05 #2
Thanks. I'm going to give digesting the thread a shot, and perhaps
recode based on that, but I just noted something else that makes me
skeptical this is purely an event-targeting problem.

Note that in IE, when you mouse over the "Online Services" <li>, the
onmouseover event doesn't fire until you get over the text within the
li. Whereas the green line is actually the border.

If IE is somehow misinterpreting the border of the <li> as the text
node (or anchor surrounding it), the behavior of the script actually
makes sense. And the question becomes: why is it doing that? Is there
any way to force it to stop?

I came up with an idea to test this: IE has an event handler called
"onmouselea ve" that does works as you might intuitively expect
"onmouseout " to -- it doesn't fire if you mouseover a subelement, it
only fires if you leave boundaries of the element you assign it to.

http://weston.canncentral.org/misc/w...ouseleave.html

Same set of troubles. It looks as if somehow in this case, IE is
confusing the boundaries of the text node with the boundaries of the LI
for event purposes.

This doesn't universally seem to be the case:

http://weston.canncentral.org/misc/w...MH/testli.html

So... what am I doing that confuses IE?

Jul 23 '05 #3

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

Similar topics

1
2501
by: Macamba | last post by:
Hi all, I am currently developing a website for a voluntary organisation. It is my first step in website development. The dynamic menu I developed has some bugs, which I addressed in another post. In this post I want to ask you why my code behaves differently in IE, while it behaves like I expect in Mozilla and Opera. What I would like to see addressed is what I need to do to get the same behaviour in all 3 browsers. I know each browser...
10
2036
by: John Ortt | last post by:
Hi Everyone, I have created a Javascript menu for my site which uses frames. The first stage loads fine but I want two drill down menus ("About Me Menu" and "Projects Menu"). The pages load fine, but the images aren't displayed, instead the alt text is shown. The images come up after you "Mouse Over" them but not before......can anybody spot any errors in my code which could be doing this please. For info, I have 4 images for each...
13
2063
by: Matthew Hagston | last post by:
Trying to do some updating and beyond frustrations with making it compatibal with Mac's I am primarily done. Biggest problem I am having now is with Opera not displaying the menu. works fine in IE, NS, and Firefox. Due to the problem of having to have it target an iframe to update had to write my own menu. Do not get any errors, simply will not display at all. code of the menu and the css file is below. location of the html file is:...
1
2439
by: M.L. | last post by:
Hi NG, I hope someone in here is able to help me in this matter. The problem: I have created a Javascript drop-down menu which expands when moving the mouse into a tablecell (calls my Expand() function at onMouseover on the <td>-element). My question is now this: How do I delay the expansion of the menu for e.g. 500 ms in order to keep it from happening "by accident". A
2
3901
by: Jackson Yap | last post by:
can someone kind enough to help me look at the attached html and js file? Why is it that the javascript menu could not work at www.apchosting.net but could work at http://home.pacific.net.sg/~jacksony ? (the drop down bar could not work at www.apchosting.net but can drop at home.pacific.net.sg. I suspect it is a server problem but was told it is not possible, therefore assuming it is a client script problem? the script works last time...
1
2389
by: Eric Trav | last post by:
Hello, I am using mozilla and javascript to change the style background color for my select with onfocus() and back to white with onblur(). When i process onfocus(); i have to click on the select three times to get the popup menu and everything seems slow. No errors are reported in the console however it seems as if the click event is not being processed after the focus event is processed.
1
2071
by: DJG79 | last post by:
Hi all, I am using an open source menu that i found and it works great, except for one thing that when the web page is not scrolled to the very top the drop down links will not stay visible. Has anyone else had this sort of problem with javascript? and any ideas how to fix it would be greatly appreciated.. I have included a copy of the code below, thanks. /**
5
13387
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL http://mghospedagem.com/images/controlpanel.jpg instead of http://mghospedagem.comhttp://mghospedagem.com/images/controlpanel.jpg As u see, there's the website URL before the image URL.
0
9687
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9543
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10237
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9077
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6808
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5588
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4144
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.