I've been searching for information on this topic, but I haven't been able to find a satisfactory answer.
I want to create a div that displays "Contact Us" and when clicked, smoothly reveals a layer with input fields.
I know I can use JavaScript to toggle between display:none and display:block, but how can I achieve a smooth transition?
Here's a basic example (the actual implementation will be more polished):
<div id="contact-us" onClick="showContactUs()">
<div id="contact-us-content" style="display: block;">
Name - <input type="text" name="name">
Email- <input type="text" name="email">
</div>
</div>
The accompanying JavaScript code is:
function showContactUs(){
var contact = document.getElementById("contact-us-content");
contact.style.display = "block";
}
If you have any tips or resources that could help me accomplish this task, please share them. I'm not very experienced with jQuery, but I am open to learning if it's a better solution.