While implementing jquery .animate(), I’ve to write like
$('#clickme').click(function() {
$('#book').animate({
width: '200px',
height: '500px'
})
})
Isn’t there some way to write the css properties in a css file and just do the ‘animate’ by including the css property??
Something like
.move{
width: '200px',
height: '500px'
}
Then
$('#book').animate({
// include the .move css class somehow
})
I tried using $( "#effect" ).addClass( "newClass", 1000 ); but there is no animation, the properties just seem to be assigned after the duration declared!!
The jQuery UI project extends the
addClassmethod to allow exactly what you’re looking for.jQuery UI –
addClass.