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

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -