From 7da6c0cf5cda38b6288c518359537b34253199c5 Mon Sep 17 00:00:00 2001 From: zmister Date: Sun, 24 Apr 2022 16:52:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=A7=BB=E5=8A=A8=E7=BD=91?= =?UTF-8?q?=E9=A1=B5=E7=AB=AF=E6=96=87=E9=9B=86=E9=A1=B5=E5=86=85=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E5=B7=A6=E4=BE=A7=E5=A4=A7=E7=BA=B2=E8=A2=AB=E9=9A=90?= =?UTF-8?q?=E8=97=8F=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/mrdoc/mrdoc-docs.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/static/mrdoc/mrdoc-docs.js b/static/mrdoc/mrdoc-docs.js index cb99adf..4672fce 100644 --- a/static/mrdoc/mrdoc-docs.js +++ b/static/mrdoc/mrdoc-docs.js @@ -61,8 +61,12 @@ tagCurrentDoc(); 小屏幕下的文集大纲显示处理 */ //监听浏览器宽度的改变 +var browserWidth = document.documentElement.clientWidth; window.onresize = function(){ - changeSidebar(); + // console.log("可视区域变动") + if(browserWidth !== document.documentElement.clientWidth){ + changeSidebar(); + } }; function changeSidebar(){ // 获取匹配指定的媒体查询