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()
1.rotate(angle)  Rotate to fixed angle
eg. $('#i1').rotate(60).

2.rotate(parameters)
parameterscontains:
  • 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
3.getRotateAngle()  return the rotate angle



4.stopRotate():stop rotate





Popular posts from this blog

Fancyapps — easily build overlay windows with carousel

Meet Tippy.js: The Complete Tooltip Popover Plugin

Meet Mantine: A TS-Based Open-Source React Components Library