Using JQuery 1.11 why does the img rotate and the input disappear:
Code:$(function() { var $elie = $("img"), degree = 0, timer; function rotate() { $elie.css({ WebkitTransform: 'rotate(' + degree + 'deg)'}); $elie.css({ '-moz-transform': 'rotate(' + degree + 'deg)'}); timer = setTimeout(function() { ++degree; rotate(); if(degree%360==0){clearTimeout(timer);} },5); } $("input").toggle(function() { clearTimeout(timer); }, function() { rotate(); }); });HTML Code:<input type="button" value=" Toggle Spin " /> <br/><br/><br/><br/> <img src="http://i.imgur.com/ABktns.jpg" />



Reply With Quote
Bookmarks