Is there an easy way to make multiple changes to the css in jQuery without the extra lines of code? i.e. I have a function:
$(function() {
$('h1[id=300]').click(function(){
$('#box').css('background','orange');
$('#box').animate({
"left" : "300px"
});
});
});
Let’s say I want to change the div box size. How would I add it within the changes that are already being applied to background color above?
Thanks
Use a object where you define the styles as argument for css() , e.g.: