dixonandmoe / rellax

Lightweight, vanilla javascript parallax library
https://dixonandmoe.com/rellax/
MIT License
7.06k stars 878 forks source link

TypeError: options is undefined #187

Closed kozyrev-artem closed 4 years ago

kozyrev-artem commented 4 years ago

File - rellax.js

Line - 177 if (options.breakpoints) { validateCustomBreakpoints(); }

When init function without options such issue appear "TypeError: options is undefined"

Init code:

import Rellax from 'rellax'; jQuery(function() { initParallax(); }); function initParallax() { jQuery('[data-parallax]').each(function() { new Rellax(this); }); }

droach587 commented 4 years ago

This is still an issue with the Yarn/NPM module :(

Kruemelkatze commented 4 years ago

Still waiting for @moeamaya to either fix this or accept my PR #188 😢

In the meantime, you can mitigate this problem by just providing an empty object as options:

var rellax = new Rellax('.parallax', {});