开发者

Fixed scrolled content

开发者 https://www.devze.com 2023-02-12 23:30 出处:网络
I\'m designing a dynamic web page that loads contents by AJAX, like the wall of facebook, first to the top last to the bottom. However, i don\'t want to change the scrolled content. For example, when

I'm designing a dynamic web page that loads contents by AJAX, like the wall of facebook, first to the top last to the bottom. However, i don't want to change the scrolled content. For example, when new contents are loaded page is driven down, but i want a script to fix scrolled content on 开发者_Go百科screen. How can I do this? Help me please.

Update

Okey, I've found the key function it is scrollBy(x,y); function of the window object. however now i want to use it with jquery animation how can i animate this function?


I don't really know if this is what you want, but i think u can record the event's clientY attribute or pageY as in jquery, & then using jquery or simple JS scroll down to the value that you had stored.


var w = $('#selector').width();
$('#selector').append(data).scrollTop(w);

i have not tested it but it has the basics on that :)

0

精彩评论

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