如果页面高度大于300PX则跳转到指定页面
2023-6-18 乱云飞 代码 评论(0) 浏览(206) 标签: 网页跳转 页面高度 检测高度
window.onload = function() {
//获取当前页面高度
var pageHeight = window.innerHeight;
//如果页面高度大于300,跳转到指定页面
if (pageHeight > 300) {
window.location.href = "http://80c.cc/?300px";
}
}