问题描述
我有以下的code运行后创建一个下拉手风琴,揭示了隐藏分区#top_mailing_hidden当格#top_mailing悬停。问题是,当我通过鼠标出来,然后将鼠标悬停中断动画它再次中止动画和螺丝了。
I have the following code running to create a dropdown accordion that reveals the hidden div "#top_mailing_hidden" when the div "#top_mailing" is hovered. The problem is that when I interrupt the animation by mousing Out and then mousing Over again it aborts the animation and screws up.
我有以下的code:
//Top Mailing List Drop down animation
$(document).ready(function () {
$('#top_mailing')
.bind("mouseenter",function () {
$("#top_mailing_hidden").stop().slideDown('slow');
})
.bind("mouseleave",function () {
$("#top_mailing_hidden").stop().slideUp('slow');
});
});
布赖恩Cherne的插件说调用函数hoverIntent如下(其中makeTall'和'makeShort'定义功能:
Brian Cherne's plugin says to call the hoverIntent function as follows (where 'makeTall' and 'makeShort' are defined functions:
$("#demo2 li").hoverIntent( makeTall, makeShort )
我觉得我得到的行为最好的解决办法是使用布赖恩Cherne的HoverIntentjQuery插件。问题是我不知道如何/在哪里插入code到上面来调用HoverIntent插件。它说叫.hoverIntent,而不是.hover但我的code使用.bind(的MouseEnter......有人请帮助!
I think the best solution for the behavior I'm getting is to use Brian Cherne's "HoverIntent" jQuery plugin. Problem is I don't know how/where to insert the code into the above to call the HoverIntent plugin. It says to call ".hoverIntent" rather than .hover but my code is using .bind("mouseEnter"... someone PLEASE HELP!
推荐答案
您仍可以使用匿名函数与hoverIntent:
You can still use anonymous functions with hoverIntent:
$('#top_mailing').hoverIntent(function () {
$("#top_mailing_hidden").stop().slideDown('slow');
},
function () {
$("#top_mailing_hidden").stop().slideUp('slow');
});
这篇关于堵jQuery中HoverIntent推拉面板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!