Home  >  Article  >  Web Front-end  >  js prevents child elements from responding to the parent element's onmouseout event specific implementation_javascript skills

js prevents child elements from responding to the parent element's onmouseout event specific implementation_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:07:471371browse
Copy code The code is as follows:

$(".target-menu").mouseout(function(e ){
evt = window.event || e;
var obj = evt.toElement || evt.relatedTarget;
var pa = this;
if(pa.contains(obj)) return false;
$(this).hide();
});
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn