From 2ae87f40751e191fcfe0dc2bfd6f97ae5484003d Mon Sep 17 00:00:00 2001 From: liang xiao <13938586+Laxse@users.noreply.github.com> Date: Sun, 28 Jul 2019 17:16:58 +0800 Subject: [PATCH] Update sakura-app.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 监听浏览器resize 需要加settimeout --- js/sakura-app.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/js/sakura-app.js b/js/sakura-app.js index 4b8b424..34930ce 100644 --- a/js/sakura-app.js +++ b/js/sakura-app.js @@ -1407,9 +1407,14 @@ var home = location.href, $('#bgvideo').css({ 'min-height': _height }); + window.resizeFlag= null; $(window).resize(function () { - Siren.AH(); - }); + //直接resize性能爆炸,改成延时 + if(resizeFlag!=null){ + clearTimeout(resizeFlag); + } + resizeFlag = setTimeout(function(){ Siren.AH();resizeFlag=null }, 1000); + }) } } else { $('.headertop').addClass('headertop-bar'); @@ -1811,4 +1816,4 @@ if ((isWebkit || isOpera || isIe) && document.getElementById && window.addEventL element.focus(); } }, false); -} \ No newline at end of file +}