michaelrafailyk / stickymate

Stickymate is a tool that designed to help web developers easily create scroll-based animations without JavaScript knowledge, just setting animation params directly in the HTML markup.
https://michaelrafailyk.github.io/stickymate/
MIT License
63 stars 5 forks source link

fix `animation.elements.forEach & classes.elements.forEach is not a function.`, regression with 1.3.0 #7

Closed hirbod closed 3 years ago

hirbod commented 3 years ago

fix animation.elements.forEach & classes.elements.forEach is not a function.

If you have bundled stickymate in your code and run it on a page for example, where NO sticky element is found, it will break the whole javascript (since the script always assume at least one data-sticky. This simple check fixes this regression introduced in 1.3.0.