I got a div to start rotating, but I am not sure how to make it stop at an angle. At the moment all that is happing is that it keeps going. My question is how do i get it to stop at an angle like 96.
<script type="text/javascript">
$(function() {
var $elie = $("#super");
rotate(1);
function rotate(degree) {
$elie.css({ WebkitTransform: 'rotate(' + degree + 'deg)'});
$elie.css({ '-moz-transform': 'rotate(' + degree + 'deg)'});
timer = setTimeout(function() {
rotate(++degree);
},2);
}
});
</script>
To stop at 96 degress, try this:
Example fiddle