Home > Web Front-end > JS Tutorial > body text

Javascript can easily make the pop-up submenu automatically disappear when the mouse is moved away_javascript skills

WBOY
Release: 2016-05-16 17:06:30
Original
1336 people have browsed it
复制代码 代码如下:







<SCRIPT> <br>var cm=null; <br>document.onclick = new Function("show(null)") <br>function getPos(el,sprop) <br>{var iPos = 0 <br>while (el!=null) <br>{iPos =el["offset" sprop] <br>el = el.offsetParent} <br>return iPos} <br>function show(el,m) <br>{if (m) { m.style.display=''; <br>m.style.pixelLeft = getPos(el,"Left") <br>m.style.pixelTop = getPos(el,"Top") el.offsetHeight} <br>if ((m!=cm) && (cm)) cm.style.display='none';cm=m} <br></SCRIPT>














Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template