开发者

Javascript Mouseover and mouseout actions

I have a code like;

<asp:HyperLink ID="hl" onmouseover="ShowDiv();" onmouseout="HideDiv();" runat="server"/>
<div ID="divid" onmouseover="ShowDiv();" onmouseout="HideDiv();">Test</div>

I want the the hyperlink to show the divid when mouse is over it and at the same开发者_StackOverflow社区 time if the user moves the pointer over div the div will not close and will continue to show, but if the user moves the cursor out of div and hyperlink the div will close. What can i implement inside ShowDiv() and HideDiv() functions.

Thank You..

Edit:The divid visibility is set to false at the beginning and it shows when mouse moves over the hyperlink


I could give you the exact answer, but I'd like you to read this article on jQuery's mouseenter and also mouseleave and you will definitely find your answer there (and also learn!) :)


Hope That Link Can Help Also


If you're using jQuery, you could use the hide() and show() functions.

<asp:HyperLink ID="hl" onmouseover="$('#divid').show();" onmouseout="$('#divid').hide();" runat="server"/>
<div ID="divid" onmouseover="$('#divid').show();" onmouseout="$('#divid').hide();">Test</div>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜