js实现代码,当页面加载前会判断屏幕的尺寸。
屏幕尺寸大于600加载index2
屏幕尺寸小于600加载index1
$(function() {
//判断屏幕宽度
var winWide = window.screen.width; //获取当前屏幕分辨率
alert(winWide);
var wideScreen = false;
if (winWide <=600) { //600及以下分辨率
window.location = "index1.html";//加载index1.html
} else { //大于600的分辨率
window.location = "index2.html";//加载index2.html
}
});
来源:CSDN
作者:牧 码人
链接:https://blog.csdn.net/qq_38697767/article/details/103743450