Advertisement
metalx1000

AOS CSS Scroll Animations with jQuery

Mar 22nd, 2017
759
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.   <title>Animation</title>
  5.   <meta charset="utf-8">
  6.   <meta name="viewport" content="width=device-width, initial-scale=1">
  7.   <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  8.   <script src="//ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  9.   <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  10.  
  11.   <!--<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">-->
  12.   <link href="//cdn.rawgit.com/michalsnik/aos/2.1.1/dist/aos.css" rel="stylesheet">
  13.   <script src="//cdn.rawgit.com/michalsnik/aos/2.1.1/dist/aos.js"></script>
  14.  
  15.   <script>
  16.     $(document).ready(function(){
  17.       for(var i=0;i<50;i++){
  18.         addItem();
  19.       };
  20.  
  21.       $(".list-group-item:odd").attr("data-aos","fade-right");
  22.       AOS.init();
  23.     });
  24.  
  25.     function addItem(){
  26.       var act = "fade-left";
  27.       var anchor = "bottom-bottom";
  28.  
  29.       $("#list").append('<a class="list-group-item" data-aos="'+act+'" data-aos-anchor-placement="'+anchor+'">Item in List</a>');
  30.     }
  31.  
  32.   </script>
  33. </head>
  34. <body>
  35.  
  36. <div class="container">
  37.   <h2 data-aos="flip-down" data-aos-duration="1000">Basic List Group</h2>
  38.   <div id="list" class="list-group">
  39.   </div>
  40. </div>
  41.  
  42. </body>
  43. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement