jQuery - trying to event capture a blur of an element w/ keypress (or leaving the div), can't
<p><strong>NOTE:</strong> </p>

<p><strong>I believe I found my solution, sorry for the long post:
I use "focusout" on the last href in the last li. seems to work so far.</strong></p>

<pre><code> var lastLi = jQuery("#items").find('li:last');
 jQuery(lastLi).last('a').focusout(function(eve){
    // close em'
 });
</code></pre>

<p>So, I am creating some code to tab thru a CSS menu. As such, I need to be aware of persons who use tab to go thru menu items. I have things working pretty good EXCEPT when they leave the last link (last LI in code below) and move to the next nav item (Link that Might exist). The menu sticks (stays open). I could just as easily put a keyup on that link and just close the previous menus, BUT because the site is dynamic, those "other links" might not exist so I can't really plan for what link follows the .</p>

<p>I was hoping to do a</p>

<pre><code>jQuery('#itemsForSale').bind('blur', function() {//close menu})
</code></pre>

<p>no luck.</p>

<p>So here is a snippet of the code. </p>

<pre><code>&lt;ul id='siteNavigation'&gt;
    &lt;li id="itemsForSale"&gt;
       &lt;div id="items"&gt;
          &lt;ul id='itemNav'&gt;
             &lt;li&gt;
                 &lt;div id="menu1"&gt;
                    &lt;ul&gt;
                       &lt;li&gt;menu 1 item 1&lt;/li&gt;
                       &lt;li&gt;menu 1 item 2&lt;/li&gt;
                    &lt;/ul&gt;
                 &lt;/div&gt;
             &lt;/li&gt;
             &lt;li&gt;
                  &lt;div id="menu2"&gt;
                    &lt;ul&gt;
                       &lt;li&gt;menu 2 item 1&lt;/li&gt;
                       &lt;li&gt;menu 2 item 2&lt;/li&gt;
                    &lt;/ul&gt;
                 &lt;/div&gt;
             &lt;/li&gt;
          &lt;/ul&gt;
       &lt;/div&gt;
    &lt;/li&gt;
    &lt;li&gt;Link that Might exist&lt;/li&gt;
    &lt;li&gt;AnotherLink that Might exist&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>So, because the last two li's might or might not be there, I am trying to capture the "blur" event on id "itemsForSale" - no luck. There doesn't seem to be a "keyout" event. Is there a way to know via tabing when I exit this particular li id="menu 2 item 2" OR the parent li id="itemsForSale"?</p>

<p>Mind you, I have pretty much all of the other tabbing etc.. working just fine. But WHen the user gets to that last item (in my case above: menu 2 item 2 ) and moves off of it, how to know that.</p>

<p>I also tried capturing the "last LI" in "itemsForSale" - that was also a no go. Blur just doens't seem to work. I also tried using a setTimeout with it, nada. Any advice?</p>

<p>Note: Remember, I have to make this determination with a keypress of tab or "shift tab".</p>

<pre><code>jQuery("#items").find('li:last')
</code></pre>
