窗口大小调整到小于767px后如何刷新页面一次?
我尝试了很多例子,但效果不佳。
$(document).ready(function(){
if ($(window).width() < 767) {
location.reload(); // refresh page
}
else {
// width more than 768px for PC
}
});
请帮忙~
最佳答案
$(document).ready(function(){
$(window).on('resize',function(){
if ($(window).width() < 767) {
location.reload(); // refresh page
}
else {
// width more than 768px for PC
}
});
});
关于jquery - 窗口宽度小于767px时如何刷新页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24753259/