0
當窗口大小改變時,我只想重新加載一次。如何使用jQuery重新加載頁面和斷點?
當窗口大小發生變化時,您只需執行一次重新加載。
原因是,pc使用標籤和智能手機變成了手風琴。
if (window.matchMedia('screen and (max-width:767px)').matches) {
location.reload();
} else if (window.matchMedia('screen and (min-width:768px)').matches) {
location.reload();
} else {
}