+ 1
How can I change background image when user scrolls on the div? PLEASE HELP
How can I change background image when the user scrolls on the div called step2? I'm almost certain that Javascript has to used. https://code.sololearn.com/WIEM419wsuDr
14 Answers
0
The thing is that u set the background image so use Js when the duv is focused then change the background
0
That is what I don't understand how to do.
0
So u are a noob to js
0
Correct
0
Ok
0
I guess you are noob as well?
0
No
0
I have spent 3 Year using it
0
So why are you complaining about me not knowing it instead of helping?
0
No let me help you
0
var focused = document.activeElement;
if (!focused || focused == document.body)
focused = null;
else if (document.querySelector)
focused = document.querySelector(":focus");
0
But where am I suppose to put the new background when the user scrolls on the div called step2
0
Well put it in the js
0
Where you want