Javascript 鼠标悬停和鼠标移出操作
我有一个类似的代码;
<asp:HyperLink ID="hl" onmouseover="ShowDiv();" onmouseout="HideDiv();" runat="server"/>
<div ID="divid" onmouseover="ShowDiv();" onmouseout="HideDiv();">Test</div>
我希望超链接在鼠标悬停在其上方时显示分区,同时如果用户将指针移到 div 上,则 div 将不会关闭并将继续显示,但如果用户将光标移出 div 和超链接div 将关闭。我可以在 ShowDiv() 和 HideDiv() 函数中实现什么。
谢谢..
编辑:分割可见性在开始时设置为 false,当鼠标移动到超链接上时会显示
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 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我可以给你确切的答案,但我希望你阅读这篇关于 jQuery 的 mouseenter 的文章还有mouseleave,你一定会在那里找到答案(并且还可以学习!):)
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
如果您使用 jQuery,则可以使用
hide()
和show()
函数。If you're using jQuery, you could use the
hide()
andshow()
functions.