Hello, Javascript/ Animation help

How can i toggle a class with workflow not click (javascript)?


I tried to toggleclass without click but didnt work:
54

#demnuicon {
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
.rotated { transform:rotate(180deg); -webkit-transform:rotate(180deg); -moz-transform:rotate(180deg); -o-transform:rotate(180deg); }

$(document).ready(function() {
$(’#dmenu’).click(function() {
$(’#demnuicon’).toggleClass(‘rotated’);
});
});

I just add and remove classes now its fine.
$(document).ready( function() {
$(’#demnuicon’).removeClass( ‘rotated’ );
} );

This topic was automatically closed after 70 days. New replies are no longer allowed.