Update sakura-app.js

监听浏览器resize 需要加settimeout
pull/96/head
liang xiao 2019-07-28 17:16:58 +08:00 committed by GitHub
parent 47afa016b1
commit 2ae87f4075
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -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);
}
}