+ -
当前位置:首页 → 问答吧 → 只有鼠标移到边框时才触发onmouseover事件

只有鼠标移到边框时才触发onmouseover事件

时间:2011-03-15

来源:互联网

只有鼠标移到边框时才触发onmouseover事件,大家把代码存到本地就知道是什么情况了
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title></title>
  <style>
  .divTest
  {
  width: 200px;
  height: 200px;
  border: 1px solid red;
  display:inline-table;
  }
  .filter
  {
  filter: Alpha(opacity=0);
  opacity: 0;
  }
  </style>

</head>
<body>
  <div class="divTest" onmouseover="this.className='divTest'" onmouseout="this.className='divTest filter'">
  fdsfsdf
  </div>
</body>
</html>

作者: chenbinqq164   发布时间: 2011-03-15

FF下ok,
IE下给div设置个背景色
.divTest
  {
  width: 200px;
  height: 200px;
  border: 1px solid red;
  display: inline-table;
  background-color:White;
  }

作者: yhtapmys   发布时间: 2011-03-15

因为透明=0 接受不到鼠标事件

作者: KK3K2005   发布时间: 2011-03-15