I'm currently facing the challenge of creating a fixed position navbar with white links that should change to black when hovering over another element with a white background.
Here is the CSS for the navbar links:
nav ul li a {color:#ffffff;}
CSS for the fixed navbar:
nav {position:fixed;}
CSS for the white background element:
div.white {background-color:#ffffff;}
Let's consider the HTML structure:
<nav><ul><li><a>Link</a></li></ul></nav>
<!-- A hero image goes here -->
<div id="heroimage"></div>
<div class="white">
Due to the fixed position of the navbar, scrolling the webpage will cause it to overlap the white div, making the links "invisible". I'm seeking a solution to make the links turn black only when they are on top of the white div.
Is there a way to achieve this using JQuery? What functions should I be looking for? I have been unable to find a solution elsewhere...