javascript - What should be the timeout for window resize dragging? -
i have code fires when user has stopped resizing window (by dragging). uses 100ms timeout not fire @ every single window resize event. i'd find balance between swiftness , unnecessary runs of code heavy. user experience standpoint, how many ms should set to? var resizeto = false; $(window).resize(function(){ if(resizeto !== false){ cleartimeout(resizeto); } resizeto = settimeout(function(){ // code }, 100); });