Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript jQuery闪烁鼠标悬停问题_Javascript_Jquery_Css_Mouseover - Fatal编程技术网

Javascript jQuery闪烁鼠标悬停问题

Javascript jQuery闪烁鼠标悬停问题,javascript,jquery,css,mouseover,Javascript,Jquery,Css,Mouseover,我有一个图像,上面显示了一个标题。标题浮动在图像上方,并显示在底部 我有一个jQuery事件,当您滚动图像时,它会显示标题。像这样: function showCaption(id) { var theID = "#caption_" + id; $(theID).fadeIn('200'); } 当你推出时: function hideCaption(id) { var theID = "#caption_" + id; $(theID).fadeOut('200'); } 但是,当您滚动

我有一个图像,上面显示了一个标题。标题浮动在图像上方,并显示在底部

我有一个jQuery事件,当您滚动图像时,它会显示标题。像这样:

function showCaption(id) {
var theID = "#caption_" + id;
$(theID).fadeIn('200');
}
当你推出时:

function hideCaption(id) {
var theID = "#caption_" + id;
$(theID).fadeOut('200');
}
但是,当您滚动标题时,它会认为您已滚动出图像并淡出。有没有办法解决这个问题

这里有一个链接:

谢谢,库尔顿,这是一个你如何做到这一点的例子。当鼠标进入标题元素时,它只需在该元素上调用
stop

$("#caption").mouseover(function() { 
    $(this).stop(); 
});

stop
函数取消在所选元素(本例中为标题元素)上运行的任何动画。

我查看了您的JS,但找不到触发标题显示的原因-您应该将事件绑定到图像的父div,这样它就不会消失。如果它当前仅绑定到图像,那就是您的问题。注-包含一个代码示例总是很有帮助的。

showCaption/hideCaption是如何/何时调用的?当您滚动图像时。下面是我代码中的一个片段:
&size=big'class='individual\u picture\u big'onmouseover=“showCaption(“”);”onmouseout=“hideCaption(“”);”/>
作为一个非常基本的示例,如果您的HTML被测试,您的jQuery将是$('.something').hover(函数(){$('.caption').fadeIn();});