我想知道你如何将lazyload.js 与Picturefill 结合起来,当lazyload 的图像语法需要img 标签和data-original 时,而Picturefill 的语法没有这些功能。
例如,这是我使用 Picturefill 对图像进行的标记:
<span data-picture data-alt="Operating room 2 stands vacant in Dr. Tariq Mahmood's closed Renaissance Hospital in Terrell, Texas.">
<span data-src="img/main1_small.jpg"></span>
<span data-src="img/main1_small_x2.jpg" data-media="(min-width: 300px) and (min-device-pixel-ratio: 2.0)"></span>
<span data-src="img/main1_small.jpg" data-media="(min-width: 300px)"></span>
<span data-src="img/main1_medium_x2.jpg" data-media="(min-width: 601px) and (min-device-pixel-ratio: 2.0)"></span>
<span data-src="img/main1_medium.jpg" data-media="(min-width: 601px)"></span>
<span data-src="img/main1_large.jpg" data-media="(min-width: 1101px)"></span>
<!-- Fallback content for non-JS browsers. Same img src as the initial, unqualified source element. -->
<noscript>
<img src="img/main1_small.jpg" alt="Operarting room 2 stands vacatn in Dr. Tariq Mahmood's closed Renaissance Hospital in Terrell, Texas.">
</noscript>
</span>
不知道我将把lazyload.js 需要的类属性放在图像标签或data-original 属性上的位置。关于如何与 Picturefill 一起实现lazyload.js 的任何想法,或任何其他在保持使用 Picturefill 的同时延迟加载图像的方法?