Home >Web Front-end >JS Tutorial >A simple example of jquery image zoom and drag_jquery

A simple example of jquery image zoom and drag_jquery

WBOY
WBOYOriginal
2016-05-16 17:04:591453browse

一、不使用jquery,简单的缩放:

复制代码 代码如下:




onMouseWheel
<SCRIPT> <br>var count = 10; <br>function Picture() <br>{ <br>count = Counting(count); <br>Resize(count); <br>return false; <br>} <br>function Counting(count){ <br>if (event.wheelDelta >= 120) <br>count ; <br>else if (event.wheelDelta <= -120) <BR>count--; <BR>return count; <BR>} <BR>function Resize(count){ <BR>oImage.style.zoom = count '0%'; <BR>oCounter.innerText = count '0%'; <BR>} <BR></SCRIPT>



Size =
100%






一、使用jquery,实现缩放和拖动:
复制代码 代码如下:




   
   
   
   


   

       

       

       
   



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