关于鼠标移入和点击事件为什么不冲突问题
<div class="clickMe" id="clickMe">猜猜我有啥?<a href="javascrip:void(0);" id="closeBtn"></a></div>
这个a标签被放置到 clickMe中,那么下面点击a标签不是也算鼠标移入到了clickMe中么,不是也应该算触发了鼠标移入事件么,为什么还能隐藏showPic呢
window.onload = function(){ var TipBox = document.getElementById("tipCon"); var ClickMe = document.getElementById("clickMe"); var showPic = document.getElementById("showPic"); var closeBtn = document.getElementById("closeBtn"); ClickMe.onmouseover = function(){ console.info("clicme"); showPic.style.display = 'block'; closeBtn.style.display = 'block'; } closeBtn.onclick = function(){ console.info("clic"); showPic.style.display = 'none'; closeBtn.style.display = 'none'; } }
另外我将tipCon设置了高以后点击关闭按钮就没有用了,这是什么原因?
.tipCon{height:200px;position:fixed;background:#efefef;color:#000;font-size:16px;text-align:center;bottom:0;right:0;}