473,386 Members | 1,820 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,386 software developers and data experts.

Mouseout parent element

164 Expert 100+
I am using jQuery to create a mouseout event on an element that contains many children.

Expand|Select|Wrap|Line Numbers
  1. <!-- simplified HTML -->
  2. <div id="wrapper">
  3.    <div id="child-1">... some content...</div>
  4.    <div id="child-2">... some content...</div>
  5. </div>
  6.  

Expand|Select|Wrap|Line Numbers
  1. // simplified JavaScript
  2. $("#wrapper").mouseout(function(){
  3.    alert("Hello World!");
  4. });
  5.  
So, as I move the mouse cursor over the wrapper and its children, as I move between the children, child-1 and child-2, the mouseout event of the parent is firing.

Is this standard? I do not recall a mouseout event firing when you mouseover children of a parent. Is there something I am forgetting to do? Someone please freshen my memory.
May 3 '12 #1

✓ answered by Dormilich

yes, this behaviour is standard since mouseover and mouseout capture/bubble. you can use the non-capturing/non-bubbling mouseenter and mouseleave instead.

1 1852
Dormilich
8,658 Expert Mod 8TB
yes, this behaviour is standard since mouseover and mouseout capture/bubble. you can use the non-capturing/non-bubbling mouseenter and mouseleave instead.
May 3 '12 #2

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

Similar topics

1
by: Paul Gobée | last post by:
What is the parent element of a button (IE6 on Win, transitional mode)? Is it the BODY, the browser default stylesheet, or something else? Contra "body is parent-element": - Buttons with no...
3
by: Markus Ernst | last post by:
Hello Reading the follwing document: http://www.w3.org/TR/WD-positioning-970131#In-flow it seems very clear that position:relative should be relative to the parent element. So in the following...
1
by: MSNews | last post by:
I am new to ASP.NET and have found these context errors in the HTML for the ASPX pages, the site/pages work fine. Can anyone explain why these warning are coming up? Regards
2
by: mjansen.merge.emed | last post by:
Is there a way to override inline within the <bodya style of an element but not do it with a style attribute on the element? I know CSS Inheritance works for some styles, but doesn't appear to...
4
by: patrizio.trinchini | last post by:
Hi all, I'm new to XSLT and maybe my problem have a very trivial answer, but I need an expert that point me in the right direction. What I would obtain is to remove all the elements that have a...
2
by: dd | last post by:
I need to know whether an element can move itself to a new parent within the DOM. I can't find any function that offers me such an ability. Here's an example of a hierarchy: -body ....div 1 ...
1
by: grossespinne | last post by:
Hi guys! I have been looking for a PHP5 class like SimpleXMLElement with the additional feature of being able to reach the parent of its element node. For example consider the following...
1
by: pbd22 | last post by:
Hi. Could some kind sould tell me what the javascript would be to get a given attribute of the parent "table" element of a given element inside that table. So, <table width="54">
22
by: waltapp | last post by:
Hello, I am working in javascript and I need to access the parent element. I have 4 different html documents in the same folder. The names are title, code, golf,tree. I am currently in the title...
2
by: draney | last post by:
I have a <div id="nav-left"> and I want a mouseover command that would add a class to that div, like this <div id="nav-left" class="magic">. It would work similar to this example: <p...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...

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.