change background image on scroll


I want to create a background image effect that will change the image when the user scroll. I’m facing a problem with the images urls, how i can fix this? How I can link an image url in jquery from a wordpress page?

Here is the code. The url is not correct and I can’t figure how to link it correctly from the js script.

    var scrollPos = $(window).scrollTop();
      if(scrollPos >= 100){
      else if(scrollPos >= 120){
      else if(scrollPos >= 150){
ZWPDev 4 months 0 Answers 12 views 0

Leave an answer