设备型号 | devicePixelRatio | screen.width | screen.height | 图片选择@3x/2X |
---|---|---|---|---|
X/XS | 3 | 375 | 812 | @3x |
XSMax | 3 | 414 | 896 | @3x |
XR | 2 | 414 | 896 | @2x |
css兼容:(用媒体查询方式)
@media only screen and (device-width: 375px) and (device-height:812px) and (-webkit-device-pixel-ratio:3) {
.list-choose .list-choose-footer{
bottom: pxTorem(22)!important;
}
}
@media only screen and (device-width: 414px) and (device-height:896px) and (-webkit-device-pixel-ratio:3) {
.list-choose .list-choose-footer{
bottom: pxTorem(22)!important;
}
}
@media only screen and (device-width: 414px) and (device-height:896px) and (-webkit-device-pixel-ratio:2) {
.list-choose .list-choose-footer{
bottom: pxTorem(22)!important;
}
}
2.IE11浏览器的兼容问题:
IE11浏览器不支持localStorage.setItem的写法,支持localStorage.test='xxxx'的格式;
支持getItem和removerItem
