[Seaside] Re: Infinite Scrolling
pdebruic at gmail.com
Mon Apr 27 23:20:14 UTC 2015
I made an JQWidgetBox endless scroll widget a while ago, but never shared it
I guess. I just uploaded it to Smalltalkhub. see:
Its a plugin for https://github.com/fredwu/jQuery-Endless-Scroll
I'm not sure if/how the Widget is out of sync with the JS code in the git
repo but its a start.
I used it like this:
renderEndlessScroll: html with: aRequest with: id
(((html jQuery id: id) endlessScroll)
visible: '#' , id;
(html jQuery ajax
script: [ :s |
s << (s jQuery class: 'loader') show.
s << (s jQuery class: 'results:visible:last')
replaceWith: [ :h | | moreItems |
moreItems := self getMoreResults: aRequest.
self renderMoreItems: moreItems from: aRequest at: id on: h ].
s << (s jQuery class: 'shown:visible')
replaceWith: [ :h |
with: [html strong: aRequest results oldResults size
asStringWithCommas ] ] ]))
> I'm implementing a blog with many posts. I'd like to implement infinite
> <http://www.sitepoint.com/jquery-infinite-scrolling-demos/> so
> that only a few posts get loaded initially and then subsequent posts get
> loaded once the person scrolls to the bottom of the page. I'd like to use
> AJAX prepend to make this happen.
> Has anyone implemented something similar? Is there a good way to trigger a
> seaside ajax call based on an element appearing on screen or a scroll
> reaching near the bottom?
> seaside mailing list
> seaside at .squeakfoundation
View this message in context: http://forum.world.st/Infinite-Scrolling-tp4821669p4822313.html
Sent from the Seaside General mailing list archive at Nabble.com.
More information about the seaside