css_browser_selector icon indicating copy to clipboard operation
css_browser_selector copied to clipboard

Performance issue on window resize event

Open oroszlanyzsolt opened this issue 10 years ago • 0 comments

I would suggest to debounce the resize event and maybe orientationchange too. The other option could be instead of modifying className which may cause constantly reflow (as far I know), could be replaced with classList https://developer.mozilla.org/en-US/docs/Web/API/Element/classList

window.addEventListener('resize', updateScreen);
window.addEventListener('orientationchange', updateScreen);

oroszlanyzsolt avatar May 02 '15 08:05 oroszlanyzsolt