AdolphYang

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

这段代码无反应:

代码如下:

 1 <script type="text/javascript">
 2         onload = function () {
 3             document.getElementById('dv1').onmouseover = function () {
 4                 var imgObj1 = document.createElement('img');
 5                 imgObj1.setAttribute('src', '1224164136-0.jpg');
 6                 imgObj1.width = '800px';
 7                 imgObj1.height = '800px';
 8                 
 9                 imgObj1.style.position = 'absolute';
10                 imgObj1.style.left = this.offsetLeft + 'px';
11                 imgObj1.style.top = this.offsetTop + this.offsetHeight + 'px';
12                 document.body.appendChild(imgObj1);
13             }
14         }
15     </script>
16 </head>
17 <body>
18     <div id="dv1">
19         哎呀<img id="img1" title="美人" alt="刷新加载" src="1224164136-0.jpg" style="width:900px;height:900px" />
20     </div>
JS中图片的放大缩小没反应

各位兄弟看看是哪里的问题,小弟不胜感激!

posted on 2015-08-01 07:17  AdolphYang  阅读(411)  评论(0)    收藏  举报