English 中文(简体)
Hide ul, JQuery
原标题:Hide ul when lost focus in JQuery

当次菜单失去重点时,我试图躲藏。

            <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>

JQuery i利用focusout活动处理损失的焦点。

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

但是,上述法典没有发挥作用。 任何人都可以建议一种办法,处理ul中失去的焦点事件。

最佳回答

Try .hover() in

$("#ActionDiv>ul>li>ul").hover(function() {
       $("#ActionDiv>ul>li>ul").show();
   },
   function(){
       $("#ActionDiv>ul>li>ul").hide();
});
问题回答

input/code>(andtextarea >>> no situ(只要我知道,如果我错!)focusblur s>(这种改动旨在回应用户-投入,而不是改变用途-events;但a>/code>s within

您可使用hover(。 但:

$( #elementID ).hover(
function(){
   // mouse-over
},
function(){
  // mouse-out
});

你们似乎正在寻找<>中途><>和<>中程>,而不是重点活动。





相关问题
Mysql trigger/events vs Cronjob

I have an auction website which let my users place an unlimited amount of autobiddings. To monitor these autobiddings something has to check the database every second. My question is if it is ...

Can an event be used as an event listener?

I m trying to expose some events from a private object which is contained inside the object I am creating and it looks like the compiler is happy with this: private WindowUpdateServer ...

鸡奸

由于将javascript DOM方法放在第html页底部(在<有人>之后)远比利用“j Query”准备活动要快得多,因此我们不得不这样做:

Attaching a property to an event in Flex/AS3

I have a parameter that needs to be passed along with an event. After unsuccessful attempts to place it on the type by extending the class, I ve been advised in another SO question to write a custom ...

jQuery bind on ajax load() event

I have a page which displays multiple blocks with results details. Inside each block I have some <a> tags with thickbox jQuery plugin attached: class="thickbox" Here is an example of one kind ...

HTML text input event

I have a form, and want to disable/enable its submit button depending on whether the form s input text fields are empty or have had text entered into them. I think this means having an event handler ...

IE doesn t run Javascript when you click back button

I ve built a shop with tons of JS running. One of the pieces of the cart, is a zip code field which is required to calculate shipping cost. This works fine going through the cart. Now clicking ...