解决办法
为resize设置一个延迟
window.onresize = function() {
var res;
if (res){clearTimeout(res)}
res = setTimeout(function(){console.log("resize triggered");},20);
};
解决办法
为resize设置一个延迟
window.onresize = function() {
var res;
if (res){clearTimeout(res)}
res = setTimeout(function(){console.log("resize triggered");},20);
};