Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript widget inspired by iPhone UITableView?

Cocoa Touch's UITableView allows a user to scroll through large numbers of data rows with good performance because it recycles table rows. Rather than create a GUI element for every single data row, a limited number of table rows is created, and simply updated with the relevant data as the user scrolls, giving the illusion of navigating up and down a very large number of table rows.

Has anyone seen this done in javascript? Is there a plugin available anywhere that will do this for me?

like image 572
morgancodes Avatar asked Jul 15 '10 18:07

morgancodes


1 Answers

infinity.js works well. It will dynamically load 'pages' behind the scenes giving you the appearance that the list has been fully loaded.

More information can be found on their Github page - https://github.com/airbnb/infinity

Additionally, I've forked the project updating it to work with Zepto. I also set it up to use any scrollable div (set up with overflow: scoll) with the class 'scrollable' - https://github.com/elliotcw/infinity

I should add that I made these changes as this is great for large lists on mobile devices, which slow down when you have to many complex elements on the page.

like image 143
elliotcw Avatar answered Oct 17 '22 01:10

elliotcw