window.onresize = function(res){
console.log(res.currentTarget.innerWidth);
// 如果浏览器屏幕判断到小于990px ,则跳转手机屏幕
if(res.currentTarget.innerWidth > 990){
window.location = "index1.html";
}
}
window.onresize = function(res){
console.log(res.currentTarget.innerWidth);
// 如果浏览器屏幕判断到小于990px ,则跳转手机屏幕
if(res.currentTarget.innerWidth > 990){
window.location = "index1.html";
}
}
本文标题:js 监听浏览器窗口大小,从而达到媒体查询效果
本文链接:https://www.haomeiwen.com/subject/ypbqzltx.html
网友评论