jquery - change color of fixed image after scrolling -
i want change color of simple icon white black - , - after amount of scrolling (due change in background color). see http://www.euimpact.com/erikverwey , scroll down - you'll see mean).
now i'm hoping in css/jquery somehow , have smooth transition, i.e. it'd possible image half black half white when crossing line.
but i'm guessing that's not possible, it?
would have switch different image @ scrolling point?
thanks lot!
i don't think possible have different colors on edge
but change color can use window scroll
a fiddle
$(window).scroll(function(){ if($(window).scrolltop()<800){ $('#fixed').css('background-color','yellow'); }else{ $('#fixed').css('background-color','white'); } })
i created fiddle div changes color on edge, have done complete mathematic, see issues. can play around fiddle find out exact values make working you.
Comments
Post a Comment