开发者

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;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜