Reputation: 2157
Is there a way to change for instance a the color of a link depending how far you have scrolled down? I'm guessing this would be accomplished with jQuery?
Upvotes: 0
Views: 67
Reputation: 313
You can use the scrollTop
property to see how far the page is scrolled down.
jQuery: http://api.jquery.com/scrollTop/
Javascript: https://developer.mozilla.org/en-US/docs/DOM/element.scrollTop
and $("html").scroll(function(){...});
for the scroll event.
$('a').css('color', 'blue')
to change color.
Upvotes: 2