I have a page with a fixed position 'go to top' <a>
which sticks to the bottom of the page as the user scrolls. It's in the footer DIV of the page like so:
.pagedown div a { position: fixed; margin-left: 8px; margin-top: 50px; width: 44px; height: 40px; color: #bd1300; background: none;}
<div class="footer"><a id="gototop" title="Go to top!" href="#">^</a></div>
Using jQuery or JS I would like to be able to change the color of the <a>
based on the true underlying background color. So far, I've looked here:
How do I detect the inherited background-color of an element using jQuery/JS?
This code doesn't seem to work for my use case. Perhaps since the <a>
in question is not really 'inside of' the rest of the page DOM as it scrolls by?
So: is there a way to detect the -true- underlying background color (ie. the background color the user would actually see in the viewport)?