Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to change the background of that div , its id is "about" that when the scroll down on it. its background changes

What I have tried:

<pre lang="HTML">
<div id="about"> </div>


JavaScript
var about = document.getElementById('about');

about.addEventListener('mouseover',function() {
    myInfo.style.background='red';
});
Posted
Updated 5-Dec-19 20:49pm

Well, you really do not need any JavaScript or frameworks for this; it is simple CSS and using the hover pseudo-class.
CSS
#about:hover { background-color: #f00; }
Reference:
How to Change Image on Hover with CSS[^]
 
Share this answer
 
Hi You can change it as i have shown in below link.
Please refer this link and try to implement to your code.
Change Bg when scrolling[^]

Let me know if you have any query.
Hope this will help you.
Thank you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900