我正在使用 jQuery 可调整大小 plugin允许用户调整嵌入视频的大小。该视频是正在调整大小的 div 的子级。这是基础知识的 fiddle http://jsfiddle.net/jrzNW/1/ .
它工作正常,直到鼠标悬停在视频本身上,然后调整大小停止,直到鼠标移离视频。我尝试在点击事件开始时将 div 设置为 show()
,但这会产生更多问题,然后解决方案。如果有人能指出我正确的方向,我将不胜感激。
最佳答案
那么,你尝试过这样的事情吗?
$('#video').on('mouseover', function() { return false; });
这应该中止为该事件注册的任何其他事情。请参阅.on()
Returning false from an event handler will automatically call
event.stopPropagation()
andevent.preventDefault()
. A false value can also be passed for the handler as a shorthand forfunction(){ return false; }
. So,$("a.disabled").on("click", false);
attaches an event handler to all links with class "disabled" that prevents them from being followed when they are clicked and also stops the event from bubbling.
关于html - 有没有办法暂时禁用嵌入视频的鼠标悬停事件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11303211/