码迷,mamicode.com
首页 > Web开发 > 详细

JS中图片的放大缩小没反应

时间:2015-08-01 07:45:56      阅读:165      评论:0      收藏:0      [点我收藏+]

标签:

这段代码无反应:

技术分享

代码如下:

技术分享
 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中图片的放大缩小没反应

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

JS中图片的放大缩小没反应

标签:

原文地址:http://www.cnblogs.com/adolphyang/p/4693582.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!