Lazy image loading with semantic markup

二次信任 提交于 2021-02-05 06:43:45

问题


I have a very image-rich site. To conserve bandwidth for users, I would like to lazy-load images as they enter the view-port. There are assorted jQuery plugins and similar that accomplish this. This comes at the price of placing the actual image url, not in the src attribute but someplace else. This makes the markup less nice, and worse, less intelligible for search engine crawlers.

Is there way to have both lazy image loading and semantic, search-engine-friendly markup?


回答1:


You do not need to put src of image somewhere else. There are a no. of plugins available. Check the following link http://www.appelsiini.net/projects/lazyload




回答2:


Note that now <img loading="lazy" is standardized, so you can just keep src as the actual source and everything works perfectly with semantics, more details at: How do you make images load lazily only when they are in the viewport?



来源:https://stackoverflow.com/questions/16029263/lazy-image-loading-with-semantic-markup

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!