Edit This Code:
<!DOCTYPE html>
<html>
<title>W3.CSS</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../lib/w3.css">

<body class="w3-container">

<h2>Animated Accordions</h2>
<p>Use any of the w3-animate-classes to fade, zoom or slide in the accordion content (w3-animate-zoom|opacity|top|bottom|left|right):</p>

<div class="w3-accordion w3-light-grey">
  <button onclick="myFunction('Demo1')" class="w3-btn-block w3-left-align">Accordion</button>
  <div id="Demo1" class="w3-accordion-content w3-animate-zoom">
    <a href="tryit.asp-filename=tryw3css_accordion_animate.html#">Link 1</a>
    <a href="tryit.asp-filename=tryw3css_accordion_animate.html#">Link 2</a>
    <a href="tryit.asp-filename=tryw3css_accordion_animate.html#">Link 3</a>
  </div>
</div>

<script>
function myFunction(id) {
    var x = document.getElementById(id);
    if (x.className.indexOf("w3-show") == -1) {
        x.className += " w3-show";
    } else {
        x.className = x.className.replace(" w3-show", "");
    }
}
</script>

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy