window.onresize has a bug in IE browser where it is executed multiple times or even loops endlessly, causing the browser to freeze
Solution:
//Place the onresize event on the div under IE browser
if(navigator.userAgent && navigator.userAgent.toLowerCase().indexOf("msie")>-1){
document.body.innerHTML = '
' document.body.innerHTML;
} else {
window.onresize = function(){
resetClientWidth();
lazyLoadImgesMethod();
};
}
ps: FF browser does not support writing onresize events on divs. Although window.onresize will not loop endlessly under FF, if there is an alert execution in the function, FF browser will also It will freeze, which is a very helpless bug.
PS: navigator.userAgent.split(";")[1].toLowerCase().indexOf("msie")>-1 This problem of judging IE will appear in the chrome browser" toLowerCase()" method undefined error.
So the correction is navigator.userAgent.toLowerCase().indexOf("msie")>-1