如果是CSS里的,可以用下面的代码适配,但是如果是的又该怎么适配呢?
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (min-device-pixel-ratio: 2) {
}
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
1. Retina.js,会造成两次图像的请求。
http://retinajs.com/
2. JS替换SRC的方法,会造成两次图像的请求。
2.1 自定义一种属性
2.2 使用某种方式匹配相应的标签
2.3 针对相应的屏幕做SRC的替换。
3.等待新标准……
扩展阅读:
http://ued.taobao.com/blog/2013/01/css-and-html5-adaptive-images/
http://www.zhangxinxu.com/wordpress/2012/10/new-pad-retina-devicepixelratio-css-page/
我有一个不完美的,抛砖引玉
没有测试过,随口回答,只想表达我的思想
楼主有什么好的方案了吗?
对于不支持srcset的浏览器,
最近在搞页面活动也碰到这样的问题。
暂时用js完成任务的