解决HiDPI/Retina显示器进入tpi时,提示缩放比例变动的问题。

dev_ec
hjm 6 years ago
parent 9e68757d50
commit 4a95592b67

@ -1113,13 +1113,16 @@ function _initZoomCheck() {
if (!IsPC()) { // 手机端不需要提示 if (!IsPC()) { // 手机端不需要提示
return; return;
} }
var isNormalZoom = Math.round(window.devicePixelRatio * 100) === 100 var ratio = Math.round(window.devicePixelRatio * 100);
// A value of 1 indicates a classic 96 DPI (76 DPI on some platforms) display, while a value of 2 is expected for HiDPI/Retina displays
var isNormalZoom = ratio === 100 || ratio === 200
if (!isNormalZoom) { if (!isNormalZoom) {
suofang(); suofang();
} }
$(window).resize(function() { $(window).resize(function() {
var isNormalZoom = Math.round(window.devicePixelRatio * 100) === 100 var ratio = Math.round(window.devicePixelRatio * 100);
var isNormalZoom = ratio === 100 || ratio === 200
if (!isNormalZoom) { if (!isNormalZoom) {
suofang(); suofang();
} else { } else {

Loading…
Cancel
Save