简体   繁体   English

YUI:将ajax内容加载到可滚动的div中,而不移动div内容

[英]YUI: load content with ajax into scrollable div without moving div content

i am trying to do same as facebook do with messaging. 我正在尝试与Facebook做相同的消息传递。 First, scroll is place on the bottom of page instead of top (default behavior). 首先,滚动位于页面底部而不是顶部(默认行为)。 When you scroll to top of div new messages are loaded but without change position of div content. 当您滚动到div顶部时,将加载新消息,但不会更改div内容的位置。 Facebook only recalculate scroll position. Facebook仅重新计算滚动位置。 So, when i load new messages on the top of scrollable div i need to stop scroll to automactily move scrollbar on the top of page. 因此,当我在可滚动div顶部加载新消息时,我需要停止滚动以自动移动页面顶部的滚动条。

I am using YUI JS library.... Any clue? 我正在使用YUI JS库。...有任何线索吗?

Did you try to make a 您是否尝试过制作

 scroll(0,0);

when the page finished loading new message content. 页面完成加载新消息内容后的时间。

You also have to make a 您还必须制作一个

 Y.one("scrollzone").syncUI();

to make YUI recalculate the height of the scrollable div. 使YUI重新计算可滚动div的高度。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM