css 判断是iphone4s
/* 兼容iphone4/4s */
@media only screen and (device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 2) {
.container {
top: 45%;
}
}
js判断是否是iphone4s
if (window.screen && window.screen.height === 480 && window.screen.width === 320 && navigator.userAgent.indexOf("iPhone") > -1) {
// console.log("iPhone4/4s");
}
.... ........ ........ .... ........ ........ .... ........ ........ .... ........ ........