Not sure if this is possible, I am trying to put a novel type document on a html page, I would like the background to stay the same for each chapter, but once they scroll down far enough to the next chapter, the background needs to change to that chapter’s (the change could be instant or smoothly doesn’t matter)
Any hints?
Of course using the jQuery library…
in your header or footer you include the jquery library…
then you include this chunk after the script above…
here is sample html to make sense of this convoluted JS…
Where your content is in the #container element, obviously. Also, update the path to the real image. There are smoother ways to transition, but you can decide how you want to do that then ask for specifics.
Also, the window height divided by 2 is so you swap images midway through the page at the bottom. I found it is smoother this way for the projects I used this on.