I'm currently working on a website where I want the arrow images to rotate when a contact form is expanded, and then rotate back when it's collapsed. Here's the code I've been using:
$(document).ready(function(){
$("#contactbutton").click(function(){
if ($("#contact").is(":hidden")){
$("#contact").slideDown("slow");
$(".arrow").rotateRight(180);
}
else{
$("#contact").slideUp("slow");
$(".arrow").rotateRight(180);
}
});
});
function closeForm(){
$("#thankyou").show("slow");
setTimeout('$("#thankyou").hide();$("#contact").slideDown("slow")', 2000);
}
In addition, I'd like the #thankyou div to fade out after 5 seconds once the form has been submitted.
Your assistance would be greatly appreciated. Thank you for taking the time to help!