问题
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