Home › Forums › CSS › Rotate div on page load › Re: Rotate div on page load
June 26, 2013 at 6:18 pm
#140637
Participant
1 -make a class holding the animation declaration.
2 – on page load add that class to the element you want
3 – enjoy the magic.
//CSS
.className{
animation:turn 1s linear;
}
@keyframes turn{
100%{transform:rotate(360deg)}
}
//jQuery
$(function(){
$(‘.myElement’).addClass(‘className’);
});
note that animation keyframes and transform require vendor prefixes