I have a navbar with poisition: fixed. Sometimes my logo isn't visible anymore because it has the same color as the div behind it. I was wondering if in JavaScript I could change the CSS (add a filter or whatever) whenever the logo is over that certain div.
poisition: fixed
div
You could use javascripts intersection observer api. It enables you to check if an element is in the viewport and where.
https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API
1.4m articles
1.4m replys
5 comments
56.9k users