javascript - Checking if window size has changes and performance/optimalization -
today i'm implementing slider plugin , have 1 question it:
i want make responsive, achive (depending on current implementation) should add function detect if browser window size has changed - , here's question - overall performance? or maybe should re-think solution , try build pure css?
the browser resize temporary , don't see big hassle slight hiccup in phase.
since refer jquery, can add
$(window).resize(function() { ... });
add withing document ready, , call 1 on load. do
$(window).resize();
as far performance, correct every little addon have effect on performance, when active. when window not resized, teh event not fired.
Comments
Post a Comment