jqueryRotate.js---jQuery plugin to rotate image by any-angle
JqueryRotate.js is a cross-browser jQuery plugin tot rotate image by any-angle with an animation support.
GitHub here
More documents here
Step1:
link the jQuery and jQueryRotate.js in the body
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript" src="jQueryRotateCompressed.js"></script>
Step2:
These images named different id .
html |
css |
Step3:
js |
Four types of rotate images:
- rotate(angle)
- rotate(parameters)
- getRotateAngle()
- stopRotate()
eg. $('#i1').rotate(60).
2.rotate(parameters)
parameters
contains:- angle [Number] :the angle to rotate,default=0
- bind [Object] : bind event
- animateTo [Number] :the angle rotating to ,default=0
- center [Array] : rotate based on center
- duration [Number] :the time last,default=1000
- step [Function] :function process after every step
- easing [Function] :easing animations
- callback[Function] :callback after animation end
4.
stopRotate()
:stop rotate