Home >Web Front-end >JS Tutorial >jQuery can control the image rotation angle effect (with demo source code download)_jquery
The example in this article describes the jQuery implementation that can control the image rotation angle effect. Share it with everyone for your reference, the details are as follows:
The screenshot of the running effect is as follows:
Click here to view the online demonstration.
The specific code is as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script src="jquery-1.7.1.min.js" type="text/javascript"></script> <style type="text/css" > img { margin-top:100px; margin-left:400px; width:300px; border:3px solid #F2F2F2; height:300px; box-shadow:4px 4px 4px #DDDDDD;} input { margin-top:10px; margin-left:480px; } </style> <script type="text/javascript" > window.onload = function () { document.getElementById('range').onchange = function () { var value = this.value; $("img").css({ "transform": "skewX(" + value + "deg)", "-webkit-transform": "skewX(" + value + "deg)", "-moz-transform": "skewX(" + value + "deg)" }); } } </script> </head> <body> <img src="3.jpg" alt=""/> <br /><br /> <input type="range" id="range" value="0" /> </body> </html>
Click here for the complete example codeDownload from this site.
Readers who are interested in more content related to jQuery special effects can check out the special topics on this site: "Summary of common classic jQuery special effects" and "Summary of jQuery animation and special effects usage".
I hope this article will be helpful to everyone in jQuery programming.