注册 登录
编程论坛 JavaScript论坛

JS求助,一直没弄明白

yanlinfeng62 发布于 2011-09-09 12:18, 648 次点击
function hh(s)
{ alert(s);
}
html:<div style="width:150px;height:150px;position: relative;border:#000 groove 1px; margin:0 auto;">
<div onmouseover=hh("sss/fff.l") style="width:100px;height:100px;position:absolute; z-index:1; left:0;top:20px; border:#063 dashed 1px">
<div id='ssh'>dd</div>
</div><img src="map.jpg" width="150px" height="150px" />
</div>

这段代码在FF google上都没问题 在IE上却有时候出现鼠标移上去之后不执行hh(s)函数,但是去掉<img>标签 就没问题
麻烦高手解答下。
6 回复
#2
foktime2011-09-09 14:37
你用IE什么版本测试?9?10?我从5.5开始到8测的都正常
#3
wangxianping2011-09-09 15:05
<html>
  <head>
     <meta http-equiv="content-type" keywords="select" description="select相关的内容" content="text/html;charset=gb2312">
     <title></title>
  </head>
  <script languang="JavaScript">
      function hh(s)
          { alert(s);
             }

  </script>
  <body>
    <div style="width:150px;height:150px;position: relative;border:#000 groove 1px; margin:0 auto;">
           <div onmouseover=hh("sss/fff.l") style="width:100px;height:100px;position:absolute; z-index:1; left:0;top:20px; border:#063 dashed 1px">
              <div id='ssh'>dd</div>
   </div>
 <img src="C:\Documents and Settings\wangxianping\桌面\banana.jpg" width="150px" height="150px" />
</div>

  </body>
</html>
#4
刘杰明2011-09-13 10:59
是IE浏览器的加载项的问题吧,设置一下就好了
#5
suiyuexiao2011-09-24 18:09
我也想知道答案,我测试过了,确实如楼主说的那样 ,我在IE8上面测试的
#6
aspic2011-09-27 14:13
程序代码:
<html>
<head>
<meta http-equiv="content-type" keywords="select" description="select相关的内容" content="text/html;charset=gb2312">
<title></title>
<script languang="JavaScript">function hh(s){alert(s);}</script>
</head>

<body>
<div style="width:150px;height:150px;position: relative;border:#000 groove 1px; margin:0 auto;">
    <div onmouseover=hh("test") style="width:100px;height:100px;position:absolute;z-index:1;left:0;top:20px;border:#063 dashed 1px">
        <div id="ssh">dd</div>
    </div>
    <img src="https://bbs.bccn.net/images/default/star_level2.gif" />
</div>
</body>
</html>
IE8没问题
#7
js新手2011-09-29 22:40
我也试了一下 可以
1