首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

如何判断鼠标是否在div上

2013-12-13 
怎么判断鼠标是否在div上input typetextdiv stylewidth:400px height:100px background:#ccc m

怎么判断鼠标是否在div上
<input type="text">
<div style="width:400px; height:100px; background:#ccc; margin-top:10px;"></div>
当input失去焦点时,判断鼠标是否在div上
[解决办法]
div添加onmouseover+mouseout事件就行了,mouseover设置全局遍历over为true,mouseout设置为false,blur的时候检查over是否为true

热点排行