I have a div which extends its height on click. The jQuery code looks like this:
$('.contact-click').click(function() {
$('#rollout').animate({
height: "375",
}, 500);
});
$('a.close').click(function() {
$('#rollout').animate({
height: "0",
}, 500);
});
I would like to have a trigger button and not an a button for opening and closing the div. But I don’t understand how to do this. For the slide() function there is a trigger option but not for animate. Why?
Thank you for your help
Or you culd just ues one button and use toggle.
Example:
And use toggle like so:
http://api.jquery.com/toggle/
Over n Out!
Edit example here http://jsfiddle.net/Xq63U/