onmouseover 是你鼠标在 alldiv上面才有效果嘛,出去当然就没了
解决方案 »
- php如何判断鼠标是否点击了a标签
- 同一个页面第二个jQuery的function()为什么不起作用
- 文本框选中或经过时css变化,可在firefox下不兼容
- 页面比较长,页面提交后,停留在当前操作的位置
- 菜鸟问题...
- iframe 高度的问题
- div的宽度设置为width:100%,如果得到这个宽度的实际值?单位px?
- 我想通过一个下拉列表的输入来控制另一个文本框的输入,当下拉列选中一值时,使文本框变为不可输入项!
- 请问如何得到当前浏览器窗口的高度和宽度值?谢谢
- 用after动态增加网页内容后, 如何清空动态增加的内容并重新赋值?
- 我在脚本中使用document.getElementById('xx').vlaue='asdfasfd'怎么没有用呢?
- 大家帮忙啊,怎样实现选择下拉框的选项后,打开的页面是弹出新页而不是在本页面打开?
var a = 0;DIV1 onmouserout a = 1AllDIVAllDIV onmouserout if a = 1 then 你的离开事件 然后最好是把a还原成0
event.fromElement!=event.toElement 并且 this.contains(event.fromElement)所以,“当鼠标移出 DIV1的时候,AllDIV 就触发了onmouseout事件”
<br>
<div id="hh" style="visibility:hidden;background-color: #CCCCCC;"">fdasfdas</div>
</div><script>
function test(tag){
var x=event.clientX;
var y=event.clientY;
var tleft=parseInt(tag.left)+1
var ttop=parseInt(tag.top)+1
var tright=parseInt(tag.left)+parseInt(tag.width)
var tbottom=parseInt(tag.top)+parseInt(tag.height)
if((tleft>=x&&tright>=x)||(tleft<=x&&tright<=x)||(ttop>=y&&tbottom>=y)||(ttop<=y&&tbottom<=y)){
hh.style.visibility = "hidden";
}else{
hh.style.visibility = "";
}
}
function showdiv(){
hh.style.visibility = "";
}
</script>