[Seaside] Re: Infinite Scrolling

Paul DeBruicker 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:
http://smalltalkhub.com/#!/~Seaside/JQueryWidgetBox

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
		script:
			(((html jQuery id: id) endlessScroll)
				fireDelay: 5000;
				fireOnce: true;
				bottomPixels: 850;
				insertAfter: '.results:visible:last';
				visible: '#' , id;
				callback:
						(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 | 
											(h span)
												class: 'shown';
												with: [html strong: aRequest results oldResults size
asStringWithCommas ] ] ]))




jrick wrote
> I'm implementing a blog with many posts. I'd like to implement infinite
> scrolling
> &lt;http://www.sitepoint.com/jquery-infinite-scrolling-demos/&gt; 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
> event
> reaching near the bottom?
> 
> Cheers,
> 
> Jeff
> 
> _______________________________________________
> seaside mailing list

> seaside at .squeakfoundation

> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside





--
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 mailing list