首页 > Web开发 > 详细

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

时间:2015-08-01 07:43:45      阅读:284      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!