问题描述
这是我的JavaScript代码
var modals = [];
modals.push({
title: 'Welcome to Lumi FansPage !',text: 'This website requires desktop web resolution to experience its features',});
modals.push({
title: 'Checking your screen resolutions',text: 'Please wait',timer: 2500,onopen: function () {
swal.showLoading()
}
}).then(function () {
});
function showLoading() {
if ($(window).width() < 1080) {
alert('Sorry,but your screen resolution cant feel all the features,please use the Desktop Version!' +
' Your resolution is ' +
window.screen.width * window.devicePixelRatio + "x" + window.screen.height * window.devicePixelRatio);
} else {
alert('Congratulations,you can experience all of its features Now! ' + ' Your resolution is ' + window.screen
.width *
window.devicePixelRatio + "x" +
window.screen.height *
window.devicePixelRatio);
}
};
swal.queue(modals);
我想在检查屏幕分辨率后用window.screen.width
显示屏幕分辨率,然后显示警报,但是在编写该代码后什么都没发生,那么如何在用此代码检查分辨率后显示警报?
modals.push({
title: 'Checking your screen resolutions',onopen: function () {
swal.showLoading()
}
}).then(function () {
})
请帮助我
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)