Advertisement
oscarviedma

Integrar scrollbooster con divi blog

Aug 12th, 2021
2,126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. <script src="https://unpkg.com/scrollbooster@2/dist/scrollbooster.min.js"></script>
  2.  
  3. <script>
  4. // ScrollBoster Entradas
  5. const scrollHorizontalEntradas = () => {
  6. new ScrollBooster({
  7. viewport: document.querySelector(".columna-entradas"),
  8. content: document.querySelector(".entradas-recientes"),
  9. scrollMode: "transform",
  10. direction: "horizontal",
  11. });
  12. };
  13.  
  14. // Inicializar ScrollBoster
  15. if (window.innerWidth > 768) {
  16. function initScroll() {
  17. scrollHorizontalEntradas();
  18. }
  19.  
  20. if (document.readyState !== "loading") {
  21. initScroll();
  22. } else {
  23. document.addEventListener("DOMContentLoaded", initScroll);
  24. }
  25. }
  26. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement