Hide ul when lost focus in JQuery..

Posted by Ramesh Vel on Stack Overflow See other posts from Stack Overflow or by Ramesh Vel
Published on 2011-01-10T09:42:21Z Indexed on 2011/01/10 9:53 UTC
Read the original article Hit count: 219

Filed under:
|
|

Hi, I am trying to hide the sub menu items(ul) when it lost focus.. my structure looks something like this

            <div id="ActionDiv" style="border-color: #0099d4; width: 120px; height: 100%">
                <ul>
                    <li><a href="#"><span id="ActionHeader">Action &nbsp; <em>
                        <img src="images/zonebar-downarrow.png" alt="dropdown" />
                    </em></span></a>
                        <ul>
                            <li><a href="javascript:TriggerAction(1)">Send Email</a></li>
                            <li><a href="javascript:TriggerAction(1)">Invite to chat</a></li>
                            <li><a href="javascript:TriggerAction(1)">Consider For Opp</a></li>
                        </ul>
                    </li>
                </ul>
            </div>

In JQuery i have used focusout event to handle the lost focus.

$("#ActionDiv>ul>li>ul").focusout(function() {
            $("#ActionDiv>ul>li>ul").hide();
});

But the above code is not working. can anyone recommend a way to handle the lost focus event in the ul.

Cheers

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about events