Showing posts with label animate div in jquery. Show all posts
Showing posts with label animate div in jquery. Show all posts

how can animate div in jquery

how can animate div in jquery

<!DOCTYPE html>
<html>
<head>
  <style>
div { width: 60px; height: 60px; float: left; }
.first { background-color: #3f3; }
.second { background-color: #33f;}
</style>
  <script src="http://code.jquery.com/jquery-1.4.4.js"></script>
</head>
<body>
  
<p><button>Run</button></p>
<div class="first"></div>
<div class="second"></div>
<script>
    $("button").click(function() {
      $("div.first").slideUp(300).delay(800).fadeIn(400);
      $("div.second").slideUp(300).fadeIn(400);
    });
</script>

</body>
</html>