pixelcog/parallax.js

Pass additional HTML attributes to parallax container

Closed this issue · 2 comments

ehrig commented

Is it possible to pass additional HTML attributes to the parallax container? I does not seem possible with the provided data attribute options.

In my specific case I need to pass CSS classes to each parallax HTML container.

Something like: data-classes="css-filter"

please check for the JavaScript initialization method, thrn you have full flexibility!

ehrig commented

Alright, I ended up using innerHTML (https://github.com/pixelcog/parallax.js#using-inner-html-for-complex-content) paired with $('.parallax-window').parallax() to init and pass style attributes to the parallax container with some vanilla JS.