I can’t seem to find a solution for this after hours of searching 🙁
I’ve tried to no avail:
jQuery('#someGlobalNav').delegate('*','keyup', function(){
if(!(jQuery('#itemsForSale').find(jQuery(this))){// do something}
jQuery("#itemsForSale, #itemsForSale > * ").focusout(function(){}
Tried using :not, and :contains.
Basically, I have a grouping of links. Lets use this below:
<div id="someGlobalNav">
<ul id='siteNavigation'>
<li id="itemsForSale">
<div id="items">
<ul id='itemNav'>
<li>
<div id="menu1">
<ul>
<li><a href="link">menu 1 item 1</a></li>
<li><a href="link">menu 1 item 2</a></li>
</ul>
</div>
</li>
<li>
<div id="menu2">
<ul>
<li><a href="link">menu 2 item 1</a></li>
<li><a href="link">menu 2 item 2</a></li>
</ul>
</div>
</li>
</ul>
</div>
</li>
<li><a href="link">Link that Might exist</a></li>
<li><a href="link">AnotherLink that Might exist</a></li>
</ul>
<div><a href="somelink">Arbitrary link</a></div>
</div>
everything is captured fine etc.. the only issue is, I want to ONLY act on elems that are NOT “itemsForSale” or its children. So, as a user keyups thru links, all is fine UNTIL they keyup on somethign outside of itemsForSale —
I figured to use :not – but I won’t know the selectors as the nav is dynamic. I tried all sorts of other things no luck.
Any ideas
An over simplified solution to your problem would be like this:
Demo on jsbin: http://jsbin.com/idijos/1/edit