Search code examples
javascriptjqueryparallaxparallax.js

How do I add and remove components? (Parallax JS)


In Parallax JS:

I have a menu that will change what is being 'parallaxed', I do not know how to change the components within the <li> tags. I think I need to stop the plugin and then start it again but cannot find the destroy command.

I am using the JQuery version.

Thank yooou

The link to the GitHub: https://github.com/wagerfield/parallax ^components to this!

Edit. I had to retype this as for some reason it lost the important but which was that I wanted to add/remove components to Parallax JS


Solution

  • After changing the DOM elements within the scene this simple line will update the whole arrangement rather nicely:

    $('#scene').parallax().parallax('updateLayers');