Is it possible to dynamically change the color of a menu based on the background color? For example, if the menu is scrolling over a black background, the menu text should be white; and if the background is white, the menu text should be black.
HTML
<div class="fixed-side-navbar">
<ul class="nav">
<li><a href="#example-one"><span>Example One</span></a></li>
<li><a href="#example-two"><span>Example Two</span></a></li>
<li><a href="#example-three"><span>Example Three</span></a></li>
<li><a href="#example-four"><span>Example Four</span></a></li>
<li><a href="#example-five"><span>Example Five</span></a></li>
<li><a href="#example-six"><span>Example Six</span></a></li>
</ul>
</div>
<div id="example-one"></div>
<div id="example-two"></div>
<div id="example-three"></div>
<div id="example-four"></div>
<div id="example-five"></div>
<div id="example-six"></div>
CSS:
.example-one {
background: black;
}
.example-two {
background: black;
}
.example-three { background: white }
.example-four { background: black }
.example-five { background: white; }
.example-six { background: black; }