Home  >  Article  >  Web Front-end  >  Sample code for changing image size with mouse wheel_javascript skills

Sample code for changing image size with mouse wheel_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:13:531406browse

Sample code for changing image size with mouse wheel
<script> <br>function onWheelZoom(obj){ <br> zoom = parseFloat(obj.style. zoom); <br> tZoom = zoom (event.wheelDelta>0 ? 0.05 : -0.05); <br> if( tZoom > 1 || tZoom<0.1 ) return true; <BR> obj.style.zoom=tZoom ; <BR>         return false; <BR>} <BR></script>

src="http://files.jb51.net/file_images/article/201311/20131120101711.png" style="zoom:1;"

onmousewheel='return onWheelZoom(this)'>

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn