You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to globally define many different rellax classes rather than use html data attributes, so that I can change them globally. However due to the need to destroy for mobile and refresh, I am hoping to use one variable and create an array of many classes each with different speed settings, like this:
if you would do it with the html data attributes, you would save some bytes because you don't bloat the js unneccessarily.
but i guess i would define a config array with objects and then loop over all:
I am trying to globally define many different rellax classes rather than use html data attributes, so that I can change them globally. However due to the need to destroy for mobile and refresh, I am hoping to use one variable and create an array of many classes each with different speed settings, like this:
let rellax = [new Rellax ('.one.has-parallax', { speed: 7, center: true, wrapper: null, round: true, vertical: true, horizontal: false, })], [new Rellax ('.two.has-parallax', { speed: 2, center: true, wrapper: null, round: true, vertical: true, horizontal: false, })];
But this breaks it. Any help? thank you.
Or maybe someone can suggest a smarter way to do this.
The text was updated successfully, but these errors were encountered: