简体   繁体   English

我必须在移动浏览器上显示1000多个未分类的图片缩略图,但我不知道如何

[英]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. 加载时间长得令人无法接受,滚动很生涩,等等。我正在使用的缩略图宽度为120px。 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 经典方式:使用分页,每页仅显示10/20/50 ..缩略图
  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) 现代(复杂)方式:在用户滚动时添加图像,当图像离开可见区域时从DOM中删除图像(最著名的示例:谷歌图片搜索)
  3. the clumsy way: splice the images together on the server, serve them as cluster of for example 3 x 5 thumbs 笨拙的方式:在服务器上将图像拼接在一起,将它们作为群集,例如3 x 5拇指

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. 当页面首先加载时,您可以加载50或数百个缩略图,如果单击更多按钮,则可以加载剩余的缩略图。 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 一次加载会使您的网页大小超过MB,这显然会花费大量时间

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我有代码可以在javascript和CSS中刷新图像时将图像随机化,以格式化图像,但我不知道如何将两者结合起来 - I've got code to randomize an image on refresh in javascript and CSS to format the image but I don't know how to combine the two 动态显示的缩略图不会出现在移动浏览器中 - Dynamically shown thumbnails don't appear in mobile browser 输入评论后出现关键错误。 我不知道如何解决(反应问题) - I got a key error after entering a comment. I don't know how to fix (react propblem) 我收到此错误,但不知道如何解决,www.example.com/undefined?1460018627809 - I got this error but don't know how to fix it, www.example.com/undefined?1460018627809 我想每页只显示 10 行。但我不知道如何? - I wana display just 10 rows per page.But i don't know how? JS:我有一个测试任务,我不知道怎么做。 你能告诉我解决这个任务的选项是什么吗? - JS: I got a test task, I don’t know how to do it. Can you tell me what are the options for solving this task? 在浏览器环境中执行1000多页/分钟 - Executing 1000+ pages/min in a browser environment 我不知道有什么区别 - I don't know the difference 我有一个错误,但我没有发现问题 - I've an error but I don't find the problem 获得所有实例化部件后,如何在Angular SPA中重新绘制ITHit Ajax文件浏览器? - How can I redraw the ITHit Ajax File Browser in an Angular SPA when I've got all the instantiated parts?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM