Vimeo floating Sun?
I'm just wondering if anyone knows how they make Vimeo floating su开发者_Go百科n. http://vimeo.com/
using jQuery .scroll function ?
anyone can give me a head start?
fiddle: http://jsfiddle.net/KpPCj/
html:
<img src="http://a.vimeocdn.com/images/land_sun.gif" id="sun" />
jquery:
$(document).scroll(function() {
$('#sun').stop(true,true).animate({
top: $(document).scrollTop() * -1
}, 2000);
});
css:
body {
background-color: #cbe8ff;
height:1000px;
}
#sun {
position:absolute;
top:0px;
left:-10px;
}
精彩评论