How can i reuse a block of jquery code without rewriting it all over again for example i got this animation and would want to repeat it in another line
$("#sign_up_btn").mouseenter(function(){
$("#sign_up_btn").animate({ opacity: "0.5" }, 300);
$("#sign_up_btn").animate({ fontSize: "200%" }, 300);
});
$("#sign_up_btn").mouseleave(function(){
$("#sign_up_btn").animate({ opacity: "0.2" }, 300);
$("#sign_up_btn").animate({ fontSize: "100%" }, 300);
});
Make a function.
Also DRY (don't repeat yourself)