Q:

Animates all divs to slide down and slide up using jquery

0

Animates all divs to slide down and slide up using jquery

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

HTML Code :

<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
  <style>
  div {
    background: #0694EC;
    margin: 3px;
    width: 80px;
    height: 100px;
    display: none;
    float: left;
  }
  </style>
  <meta charset="utf-8">
  <title>Animates all divs to slide down and slide up</title>
</head>
<body>
  <button class="btn1">Slide down</button>
  <button class="btn2">Slide up</button>
<br><br>
  <div></div>
<div></div>
<div></div>
</body>
</html>

JavaScript Code :

$(".btn1").click(function(){
        $("div").slideDown();
    });  
$(".btn2").click(function(){
        $("div").slideUp();
    });

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now