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:
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>
I hope this article will be helpful to everyone in jQuery programming.
For more jQuery implementations that can control the image rotation angle effect, please pay attention to the PHP Chinese website!