I added the logo as a background-image and I have 4 divs (#home, #about, #projects, #contact). Now I want to change the logo when the page is scrolled to a certain div, e.g.: when scrolled to #about the logo should change to logo-dark.png and the width should be reduced to 50px. How can I do this?
<div class="logo">
<a href="#home"> </a>
</div>
<div class="content">
<div id="home">
</div>
<div id="about">
</div>
<div id="projects">
</div>
<div id="contact">
</div>
</div>
Here's the CSS:
.logo {
position: absolute;
height: 65px;
width: 230px;
top: 25px;
left: 0;
}
.logo a{
background: url('../images/logo.png');
display: block;
height: inherit;
width: inherit;
}