function rotateImage(degree) { $('#image').animate({ transform: degree }, { step: function(now,fx) { $(this).css({ '-webkit-transform':'rotate('+now+'deg)', '-moz-transform':'rotate('+now+'deg)', 'transform':'rotate('+now+'deg)' }); } }); } </script>
<div> <label>Rotate Image:</label> <input type="button" class="btnRotate" value="90" onClick="rotateImage(this.value);" /> <input type="button" class="btnRotate" value="-90" onClick="rotateImage(this.value);" /> <input type="button" class="btnRotate" value="180" onClick="rotateImage(this.value);" /> <input type="button" class="btnRotate" value="360" onClick="rotateImage(this.value);" /> </div> <div><img src="mobile.jpg" id="image" /></div>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)