jquery悬停问题
考虑我的 HTML,
<div class="abu">
<div id="pfabricsmenu1" class="box_conti_homepage">
<h2 class="tel_title"><a rel="dropmenu1" href="/new_site/?page_id=127">Telecommunications</a><br />
<img title="Telecommunications" src="wp-content/uploads/2011/03/box_image.jpg" alt="Telecommunications" width="191" height="76" />
</h2>
<div id="dropmenu1" class="box_text_homepage">
<ul>
<li><a href="/new_site/?page_id=174">Business Telephone Systems</a></li>
<li><a href="/new_site/?page_id=66">Hosted IP Telephony</a></li>
<li><a href="/new_site/?page_id=67">Fixed Line Telecoms Management</a></li>
<li><a href="/new_site/?page_id=83">Mobile Telecoms Management</a></li>
<li><a href="/new_site/?page_id=85">Inbound Call management</a></li>
<li><a href="/new_site/?page_id=70">Telephone Support Services</a></li>
</ul>
</div>
</div>
<div class="mou">Getting the best from your telecoms with the latest technology to suit your business.</div>
</div>
我想将鼠标悬停在
上,这样 div.box_text_homepage
当鼠标悬停在其上方时向下滑动,当鼠标悬停时向上滑动。我的问题是,即使鼠标位于 div.box_text_homepage
上,菜单也会向后滑动,我该如何阻止它?
$('.box_title_bar_homepage .abu').each(function(){
var $maindiv = this;
$(this).find('h2').hoverIntent(function(){
$($maindiv).find('.box_text_homepage').slideDown();
},function(){
$($maindiv).find('.box_text_homepage').slideUp();
})
})
Consider my HTML
<div class="abu">
<div id="pfabricsmenu1" class="box_conti_homepage">
<h2 class="tel_title"><a rel="dropmenu1" href="/new_site/?page_id=127">Telecommunications</a><br />
<img title="Telecommunications" src="wp-content/uploads/2011/03/box_image.jpg" alt="Telecommunications" width="191" height="76" />
</h2>
<div id="dropmenu1" class="box_text_homepage">
<ul>
<li><a href="/new_site/?page_id=174">Business Telephone Systems</a></li>
<li><a href="/new_site/?page_id=66">Hosted IP Telephony</a></li>
<li><a href="/new_site/?page_id=67">Fixed Line Telecoms Management</a></li>
<li><a href="/new_site/?page_id=83">Mobile Telecoms Management</a></li>
<li><a href="/new_site/?page_id=85">Inbound Call management</a></li>
<li><a href="/new_site/?page_id=70">Telephone Support Services</a></li>
</ul>
</div>
</div>
<div class="mou">Getting the best from your telecoms with the latest technology to suit your business.</div>
</div>
I would like to do hover on <h2>
such that div.box_text_homepage
slides down when the mouse is over it and slides up when the mouse is hovered out. My problem is that the menu slides back up even when the mouse is over div.box_text_homepage
, how do I stop that?
$('.box_title_bar_homepage .abu').each(function(){
var $maindiv = this;
$(this).find('h2').hoverIntent(function(){
$($maindiv).find('.box_text_homepage').slideDown();
},function(){
$($maindiv).find('.box_text_homepage').slideUp();
})
})
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
试试这个:
try this:
为什么不是这样的:
Why not something like this: