473,666 Members | 2,278 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

please explain this "simple" mouseover behavior... bubbling?

This has surely been answered somewhere multiple times, but...
I'm guessing it's some sort of "bubbling" thing....

<STYLE>
..triggerarea {
border:#00C solid 1px;
}
</STYLE>

<UL ID="menu">
<LI class="triggera rea" onmouseover="al ert('triggered' );">Here's nested
list...
<UL>
<LI>Why does mousing over each individual</LI>
<LI>list item trigger the event?</LI>
<LI>I only want/expect it to be triggered</LI>
<LI>by the "container" LIs </LI>
<LI>(which I've put a blue border around)</LI>
<LI class="triggera rea" onmouseover="al ert('triggered' );">another
nested list
<UL>
<LI>again, every LI is triggering</LI>
<LI>not just the container</LI>
</UL>
</LI>
<LI><A HREF="#">A Link</A></LI>
<LI>Nothing to see here</LI>
</UL>
</LI>
<LI>this item shouldn't and doesn't do anything</LI>
</UL>

Dec 21 '05 #1
3 3324
VK

BKDotCom wrote:
This has surely been answered somewhere multiple times, but...
I'm guessing it's some sort of "bubbling" thing....


You are right with both of your guessings :-)
<http://groups.google.c om/group/comp.lang.javas cript/browse_frm/thread/083ed9630b81dee 9/cd81fab7ffdfadd 7#cd81fab7ffdfa dd7>

btw: there is nothing "simple" in this problem. That is one of these
"simple" things which leaves hell's doors loose.
Another "simple" question of such kind is for instance "how to know the
exact position of element on the page".

Dec 21 '05 #2
BKDotCom wrote:
This has surely been answered somewhere multiple times, but...
I'm guessing it's some sort of "bubbling" thing....


Yes. It's not simple but it's not too hard once you get your head
around the solution. There is no need to wade through the thread posted
by VK (but do so if you want to bone-up on inter-poster rivalry).

Read (and follow the "next" links):

<URL:http://www.quirksmode. org/js/introevents.htm l>
[...]

--
Rob
Dec 22 '05 #3
> Why does mousing over each individual list item trigger the event?

Because when you move your mouse towards to another element (even if
it's inside the <ul>), you're firing the <ul>'s mouseout...

But due to event bubbling, when you're over the <li>, the <ul>
mouseover is fired again...

I only want/expect it to be triggered by the "container" LIs


You still can achieve this objective, but the possible solutions that I
see are ugly, since you'll have to control where the mouse is in a
sort of manually way ;]

Maybe this can be useful:
http://www.mozilla.org/docs/dom/domr...ent_ref20.html
--
"Invente, Tente!!! Faça um código eficiente" (eu)

Jonas Raoni Soares Silva
---------------------------
jonasraoni at gmail dot com
http://www.jsfromhell.com

Dec 22 '05 #4

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

Similar topics

1
2088
by: Mark Creelman | last post by:
Hello all: I am attempting to use a database program that I downloaded from http://www.thescripts.com/serversidescripting/perl/tutorials/asimpledatabaseprogram/database.txt with good success. I have already modified it heavily with good results. I am however stuck on something that I feel should have been built into it, but for some reason wasn't. During the search routine of the script that searches the database for a match based on...
1
1700
by: Dario de Judicibus | last post by:
I wish to create two simple layouts by using only HTML, CSS and the minimum JavaScript as possible. Layouts should be "elastic" (no fixed widths and heights) and cross-browser enabled. The first one is a non-scrollable page which contains a centered title and a centered division with automatic scrolling on overflow, that is: +---------------------+ | TITLE | | +--------------++ |
1
264
by: Ray Watson | last post by:
Hi all I thought there might be an easy way to have a separate label or picture on web page change as the cursor passes over different buttons on the same web form. In access I could use the "on mouse move" event, but the buttons on web forms don't seem to have that event. Any hints at the process would be greatly appreciated. Cheers
2
2061
by: mantas44 | last post by:
Hello all, I have two tables tab_a id(int) tab_b id(int)
2
1657
by: Axel Dahmen | last post by:
Hi, I'd like to write a simple COM Automation Server in C# but couldn't find a matching project. I want to have the IDE maintain the IDL and the REG file automatically. Which project should I use to achieve this? TIA, Axel
8
3687
by: Beam_Us_Up_Scotty | last post by:
Hello all, I am trying to write a "simple" animation using C#, and I've tried many things but nothing seems to work for me without leaking memory. Here's a very simple piece of code that uses a timer to set the image of a label from an ImageList every 100ms or so. This is what was being used when I inherited this piece of code, and I thought it was OK, until I changed the size of the label to do animation on a larger piece of screen...
6
3706
by: JPSutor | last post by:
Does anyone have an example of a simple FTP trasfer app? All I need to do is transfer one file up to a web site and then retrieve it again. Every example I run into is loaded with code that, to some extent, is unnecessary Just the basics, set the host name, port number, userID and password, path to upload to and path to download to and file name.
23
1714
by: Sacred Heart | last post by:
Hi, I'm new to Python and have come across a problem I don't know how to solve, enter com.lang.python :) I'm writing some small apps to learn the language, and I like it a lot so far. My problem I've stumbled upon is that I don't know how to do what I want. I want to do a loop in a loop. I think.
2
1631
by: fordie1000 | last post by:
Hi, Although I have been programming in python for years ... I rarely use classes .... just functions etc. .... anyway I was wondering if there is someone who could give me a simple way of remembering/understanding what a class is .... and when it should be used. Thanks,
0
8440
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
8866
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8781
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
8550
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
8638
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5662
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
4365
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2769
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
2
1769
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.