简体   繁体   中英

I've got to display 1000+ uncategorized picture thumbnails on a mobile browser and I don't know how

Everything I try falls short when testing on a mobile. Loading times are unacceptably long, scrolling is jerky, etc. Thumbnails I'm working with are 120px wide. I understand this is not a specific question but I'd like to hear how would you approach this kind of problem?

I can think of three approaches

  1. the classic way: use pagination, display only 10/20/50.. thumbnails per page
  2. the modern (complex) way: add images when the user is scrolling, remove images from the DOM when they leave the visible area (best known example: the google picture search)
  3. the clumsy way: splice the images together on the server, serve them as cluster of for example 3 x 5 thumbs

I would suggest you not to make all the thumbnails load at once. You can load 50 or hundred thumbnails when the page loads first and load remaining if they click on load more. Or you can organize them into pages

Loading at once makes your web page size more than an MB which will obviously take a lot of time to load

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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