Now, I'd like to do the very same two animations for another object plus I need the #button (what do you call this element in this example? Trigger?) to be something else. How will I do this best?
Have you seen the screen-casts on jQuery? I think the second one could help you out. Chris shows you how to make you own functions. I highly recommend it for solving your problem, if you haven't already watched it.
$('#button').click(function(){$('#box1').animate({width: 300, height: 250}, 1000);
$('#box1').animate({opacity: 0.75}, 2000);
});
Now, I'd like to do the very same two animations for another object plus I need the #button (what do you call this element in this example? Trigger?) to be something else. How will I do this best?
Thanks,
Oskar
http://css-tricks.com/video-screencasts ... -jquery-2/
Check it out.