JQuery: select all DIVs nested under a specific DIV
I have an architecture like this:
<div id="container">
<div>stuff here</div>
<div>stuff here</div>
<div>stuff here</div>
<div>stuff here</div>
</div>
I want, using jQuery, to hide the cursor when the mouse enters #container
. However, since nested divs appear on top, this is not entirely true. How to hide the mouse cursor when hovering over any of the divs in #container
. Below is the code for hiding the cursor.
$('#container').mouseover(function()
{
$(this).css({cursor: 'none'});
});
a source to share
Unless I say this, you can just attack both parent and child divs?
$('#container, #container div').mouseover(function()
{
$(this).css({cursor: 'none'});
});
I haven't tested this of course, but I had to use a similar method to change the cursor <li>
with the child <label>
.
You can extend this function a bit by using the function children()
.
a source to share