[英]use onmouseout to run when mouse is not over the element?
I read this topic What event to use instead of onmouseout to run when mouse is not over the element? 我阅读了本主题,当鼠标不在元素上方时,要使用什么事件而不是onmouseout来运行?
The proposed method has not approached me . 所提出的方法尚未接近我。
How to determine that the cursor is moved to a other element? 如何确定光标已移动到另一个元素? I search alternative
我寻找替代品
Not sure what you are really looking for, but to check an event, that occures when entering / leaving an element you should use onmouseenter / leave
-events 不确定您真正在寻找什么,但是要检查一个事件,该事件在输入/离开元素时发生,您应该使用
onmouseenter / leave
-events
As an alternative you could check something similiar by writing your own snippet, something like that: (just an example approach) 作为替代方案,您可以通过编写自己的代码片段来检查类似内容,例如:(仅是示例方法)
$(document).mousemove(function(evt){
// lets say you look for something like #header
var myTarget = "header";
var currentTarget = $(evt.target);
if(myTarget != currentTarget.attr('id') ) {
console.log('not on header')
} else {
console.log('on header')
}
})
edit Maybe you can give an example, so we could help more quick? 编辑也许您可以举个例子,这样我们可以更快地帮助您?
best 最好
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.