If I have this
window.onresize = function() {
alert(\'resized!!\');
};
My function gets fired multiple times throughout the res
I liked Pim Jager's elegant solution, though I think that there's an extra paren at the end and I think that maybe the setTimeout should be "timeOut = setTimeout(func,100);"
Here's my version using Dojo (assuming a function defined called demo_resize())...
var _semaphorRS = null;
dojo.connect(window,"resize",function(){
if (_semaphorRS != null) clearTimeout(_semaphorRS);
_semaphorRS = setTimeout(demo_resize, 500);
});
Note: in my version the trailing paren IS required.