So I´m working on a landing page (test site here: http://kingdomhousedev.cloudaccess.host/) that has a fixed pgn logo. Since it´s white and some of the background is also white it disapears over those sections.
So what I´m wanting to do is change the logo to black when it´s over white or light sections.
Can this be achived using javascript and css? I´ve searched and found some one example (like:http://www.kennethcachia.com/background-check/) but I want it to happen at scroll and not after. If possible it would be nice if it would be so that for example if only half the logo was over white only that part would be black.
Thanks in advance for the help!
Edit:
I was asked for an example not from a live site. So here is one: https://jsfiddle.net/57Legkq3/9/
HTML:
<div class="black"></div>
<div class="white"></div>
<div class="black"></div>
<div class="white"></div>
<div class="black"></div>
<div class="white"></div>
<div class="logo"></div>
CSS:
.white{
background-color:white;
height: 400px;
}
.black{
background-color:black;
height: 400px;
}
.logo {
width: 100px;
height: 100px;
width: 100px;
height: 100px;
background-color:white;
position: fixed;
top: 20px;
left: 20px;
}
.white {
background-color: white;
height: 400px;
}
.black {
background-color: black;
height: 400px;
}
.logo {
width: 100px;
height: 100px;
width: 100px;
height: 100px;
background-color: white;
position: fixed;
top: 20px;
left: 20px;
}
<div class="black"></div>
<div class="white"></div>
<div class="black"></div>
<div class="white"></div>
<div class="black"></div>
<div class="white"></div>
<div class="logo"></div>
Also to clarify. I want the white box (representing the logo) to change color to black when going over the white areas. But without me knowing where the white areas are. So I need to check somehow what is under the logo and change color based on that, and preferably only the part of the logo that is over the white area.