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
First, you'll need to be using something to compile your javascript, like webpack or browserify or similar. Alternatively, you could toss <script src='https://unpkg.com/[email protected]/dist/paralless.umd.js'></script> into your page and use it directly as window.paralless.
Then:
Define data attributes on the elements you want to parallax, according to the README
Call paralless()() to kick things off
The docs are a little confusing because this library was built for use in a single page application SPA. In that case, what I do is create an instance and assign it to a variable like parallax, and then call that instance when the page changes.
constparallax=paralless()// does not start parallaxing yetparallax()// start parallaxing/** * Psuedo-code */router.on('update',()=>{parallax()// bind parallax to any new dom nodes})/**To destroy the instance and stop parallaxing,call the function returned from each parallax() call parallax()()which is the same as const destroy = parallax() destroy()*/
Would love to try it out but don't understand the Usage info in your readme.
The text was updated successfully, but these errors were encountered: