开发者

jquery div scrolling position

Can someone help me to understand what makes left panel on the blog post autoscroll? With social links

http://www.sohtanaka.com/web-design/nomination-judge-the-net-magazine-awards/

maybe plugin?

if not tutorial link will be helpfull..

want this effect so开发者_JAVA百科oo much.


There is a similar tutorial here: http://css-tricks.com/scrollfollow-sidebar/


It is simply done with a little JavaScript. The links are set to be positioned absolute and then a JavaScript function sets the top of the menu to be level with the scroll position of the window if the scroll position is below a certain level. This might be done with an interval so the JavaScript can check regularly the position of the scrollbar.

So something like the following would help, bit of CSS and JavaScript(jQuery):

#menu {position:absolute;}

setInterval(function(){
    // All the code to find out where to put the menu goes here. for instance:
    $('#menu').css({top: $(window).scrollTop()});
}, 10);

This isn't a working example, just an example of the technique. But as you said I am sure you can find a plugin through google.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜