項目中使用confirm
mui.confirm('您還未抽獎,現在去抽獎嗎?', function (res) {
if (res.index === 1) {
window.location.href = Url
}
})
安卓手機沒有問題,但蘋果手機中點擊“確認”跳轉頁面后,點擊返回,返回的頁面無法滾動,也無法點擊任何元素。(點擊確認按鈕曾經出現的位置,發現頁面還會跳轉,說明確認按鈕還在頁面中)
解決辦法
mui.confirm('您還未抽獎,現在去抽獎嗎?', function (res) {
if (res.index === 1) {
$('.mui-popup-backdrop').remove(); // 去除遮罩
$('.mui-popup').remove(); // 去除彈出窗口
window.location.href = Url
}
});
還有一種解決辦法就是延時,時間還不能太短,測試時100,200都不行,500可以,其他沒測(因為時間比較長,還不確定,所以使用了上面的方法)
setTimeout(function () {
window.location.href = Url
}, 500);