rotation - Jquery Rotate Value Starts at 0? -
i have image when jquery loads, rotates right 90deg once. rotate 180deg once image clicked total rotation of 270deg.
once clicked again, add function rotates back, can't until can stop rotation starting @ 0deg.
$('#options').click( function () { //$(this).stop().animate({ 'padding-left': (getclwidth) }); $('.options_open').animate({ 90:borderspacing: 180 }, { step: function (currentstep) { $(this).css('transform', 'rotate('+ currentstep +'deg)'); $(this).css('-ms-transform', 'rotate(' + currentstep + 'deg)'); $(this).css('-webkit-transform', 'rotate(' + currentstep + 'deg)'); }, duration: 2500 }, 'linear'); });
i'd suggest 1 of following:
after first function completes set class position/rotate image last frame after first function executed, , start there moving original position trigger first class;
or can have boolean variable check if got clicked already, if it's clicked, start .css rotating 180 degree, rotate first place, don't forget reset boolean variable after doing that, can check on , on in both animating functions
also since you're using css3 transition should supply functionality browsers lack, check here
Comments
Post a Comment