作家
登录

JS 图片缩放效果代码

作者: 来源:www.28hudong.com 2013-03-30 01:32:03 阅读 我要评论

复制代码 代码如下:<HTML> <HEAD> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <TITLE>onMouseWheel</TITLE> <SCRIPT> var count = 10; function Picture() { count = Counting(count); Resize(count); return false; } function Counting(count){ if (event.wheelDelta >= 120) count++; else if (event.wheelDelta <= -120) count--; return count; } function Resize(count){ oImage.style.zoom = count + '0%'; oCounter.innerText = count + '0%'; } </SCRIPT> </HEAD> <BODY> <div align=center> <span style="font-weight:bold">Size = <span id="oCounter" style="color:red;">100%</span></span> <img id="oImage" src="images/aaa.gif" onmousewheel="return Picture();" > </div> </BODY> </HTML>

  推荐阅读

  javascript createAdder函数功能与使用说明

英文原文 createAdder(x) is a function that returns a function. In JavaScript, functions are first-class objects: they can be passed to other functions as arguments and returned from functions as wel>>>详细阅读


本文标题:JS 图片缩放效果代码

地址:http://www.17bianji.com/kaifa2/JS/26247.html

关键词: 探索发现

乐购科技部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与乐购科技进行文章共享合作。

网友点评
自媒体专栏

评论

热度

精彩导读
栏目ID=71的表不存在(操作类型=0)