Closed DeeptiMota closed 6 years ago
var ImageArray = ['img/code-bg-1.png','img/code-bg-2.png','img/code-bg-3.png','img/code-bg-4.png'];
$('.parallax-slider').eq(1).attr("src", ImageArray[Math.floor(Math.random() * ImageArray.length)]);
here is an example where I am randomly choosing an image. Try editing the 'src' attribute of the 'parallax-slider' class instead.
Didn't work for me. Any other option?
Just removed ".eq(1)" from the provided example and it worked, ref: https://stackoverflow.com/questions/29020247/changing-the-parallax-image-in-parallax-js.
Thanks!
Hi There,
I have implemented parallax effect in the top header (~400px) of my website and have an functionality to change that banner image by browsing a new image.
To achieve the same, I need to store the browsed file address locally, need to reload the page and then set the stored image file while loading of the age. Code:
Can't it be achieved simply, without reload()?