i'm trying create following effect:
- unless you've scrolled down 100 px or more, won't see element (e.g. div).
- when you've scrolled 100 px, , keep scrolling, in smooth way div element appear, , it'll have shown when you've scrolled 200 px.
this means won't appear transition effect. rather, if let's scroll 150 px, can see div element transparent effect (50% since @ 100 px starts fade in , @ 200 px has shown up). if scroll 175 px, can see div more. , if reach 200 px , continue scrolling down, div stay visible.
same up: if scroll it'll gradually disappear.
this android page: header in top of screen appear gradually , stay @ top (using position: fixed;
).
only last thing have clarify making effect mean css change: @ 120 px opacity
going have 0.2
(20% visible), @ 155 of 0.55
, @ 183 of 0.83
.
note: it's possible! i've seen before! =)
if understand right try this:
$( window ).scroll(function() { var top = $( window ).scrolltop( ); var opacity = (top-100)/100; fixedelement.css("opacity",opacity); });
demo:
Comments
Post a Comment