![](/img/trans.png)
[英]trigger infinite-scroll when there's not enough content for scroll bar on page load
[英]trigger infiniteajaxscrolling when there's initially not enough content for scroll bar on page load
我正在使用infiniteajaxscrolling ,但是我最初的ajax調用經常(取決於屏幕大小)包含的內容不足以顯示滾動條。
沒有滾動條,就沒有滾動事件=>無限滾動永遠不會開始嗎?
如何讓ias加載內容,直到至少可見滾動條?
(當然,只是自己編寫 )。
是否有這樣的事情已經在ias中實施,我只需要激活即可?
我嘗試僅在“渲染的”事件上調用ias.next(),但這很有趣地導致重復加載內容。 我想是因為然后以某種方式觸發了滾動事件...
好的,看來,問題是,調用“ rendered” 后加載了下一個URL。 不要問我為什么...
這似乎是一種無需費力就可以輕松修復的方法。 只是快速加載新的下一個URL。 在我的測試中似乎沒有破壞任何東西...
ias.on("loaded", $.proxy(function(data, items)
{
this.nextUrl = this.getNextUrl(data); // fast forward for next() in on.'rendered'
}, ias));
ias.on('rendered',$.proxy(function(items)
{
if($(CONTAINER).height() <= $(window).height()) // call until scroll bars are shown
{
this.next();
}
}), ias);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.