async.html 979 B

1234567891011121314151617181920212223242526272829303132333435
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>AOS - Animate on scroll library</title>
  6. <meta name="viewport" content="width=device-width">
  7. <link rel="stylesheet" href="css/styles.css" />
  8. <link rel="stylesheet" href="../dist/aos.css" />
  9. </head>
  10. <body>
  11. <div id="aos-demo" class="aos-all"></div>
  12. <script src="../dist/aos.js"></script>
  13. <script>
  14. AOS.init({
  15. easing: 'ease-in-out-sine'
  16. });
  17. setInterval(addItem, 300);
  18. var itemsCounter = 1;
  19. var container = document.getElementById('aos-demo');
  20. function addItem () {
  21. if (itemsCounter > 42) return;
  22. var item = document.createElement('div');
  23. item.classList.add('aos-item');
  24. item.setAttribute('data-aos', 'fade-up');
  25. item.innerHTML = '<div class="aos-item__inner"><h3>' + itemsCounter + '</h3></div>';
  26. container.appendChild(item);
  27. itemsCounter++;
  28. }
  29. </script>
  30. </body>
  31. </html>