if (/Android/gi.test(navigator.userAgent)) { const innerHeight = window.innerHeight; window.addEventListener('resize', () => { const newInnerHeight = window.innerHeight; if (innerHeight > newInnerHeight) { $(".later_num").html(formatNum($("#reChargeM").val())) } else { $(".later_num").html(formatNum($("#reChargeM").val())) } }); } else { window.addEventListener('focusin', () => { $(".later_num").html(formatNum($("#reChargeM").val())) }); window.addEventListener('focusout', () => { $(".later_num").html(formatNum($("#reChargeM").val())) }); }
第一个条件适用于安卓手机,第二个条件适用于苹果手机