Posts

Showing posts with the label setTimeout

Random Rant On CSS3 Transitions

Update Thanks to @gregersrygg for his link and hints, this is a hackish way to solve the problem apparently cross browser and trustable ... still a hack! // this save one char, how cool is that! !function(document){ // (C) WebReflection (As It Is) - Mit Style // we all love function declarations function redraw() { // clientHeight returns 0 if not present in the DOM // e.g. document.removeChild(document.documentElement); // also some crazy guy may swap runtime the whole HTML element // this is why the documentElement should be always discovered // and if present, it should be a node of the document // In all these cases the returned value is true // otherwise what is there cannot really be considered as painted return !!(document.documentElement || 0).clientHeight; } // ideally an Object.defineProperty // unfortunately some engine will complain // if used against DOM...

setTimeout and setInterval with extra arguments ... once again!

Funny discussion today on twitter about " why on Earth IE still does not support extra arguments with setTimeout and setInterval " ... oh, well ... The execScript Behaviour Somebody in IE team thinks that the rest of the world should avoid extra arguments because of a bloody edge case as the third argument in IE is: // ... seriously ... setTimeout("Msgbox('WTF')", 0, "VBScript"); What IE Users Could Do Well, rather than create a closure every bloody time we would like to reuse a function with different arguments, something posible 10 years ago via ActionScript 1, every web developer (and not only) misses the opportunity to avoid closures using a de-facto standard for some unknown reason not part yet of ECMAScript specifications. For those interested I will show an example later, right now let's think about a solution compatible with VBScript for those mental developers, as I have been, brave enough to still use this language for some purpose. ...