- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
First...
Admin
if (img.src.indexOf("First")!=-1) { img.src="Second" ...
Admin
claps slowly
At first I thought "well maybe they didn't want to use .gifs. Then I realized that they were using them anyway. Plus you just KNOW someone spent ll afternoon making those 4 images. And they probably had the experience to make them into a .gif. I guess when some people get an idea in their head about how to fix something nothing will stop them. Not even many many CPU cycles!
Admin
Now for the comment...
here's an easy way around that... just create the gif animation in GIMP as one file then stick it in there. Why would one need programming to animate a gif when they themselves are already animated?
Admin
Nooo, I made the infamous "didn't close quotes grammar mistake.
Admin
Is it me or does the article point that out itself?
But kudos on being Fist.
Admin
Hang on, doesn't it say that in the article?
Admin
Wow. You do realise the purpose of this site?
Admin
...but I have animated GIFs shut off in my browser, so there!
Which reminds me, he forgot the code for what to do if JavaScript is shut off.
Admin
Actually, there is a perfectly good reason to do this. If you have a "report running" page that has been submitted, Firefox will often stop all running animations on the page. This is not a problem in IE. By doing it with javascript, it avoids this problem.
Admin
iframe, with meta refresh tag and some serverside mechanism to determine the next picture :).
Admin
Come to think of it, the article mentions the same thing already.
Admin
O....M......G......!!!!
You submit a 'first post' which is soooo lame it's ludicrous, and then 4 minutes later post a comment that is spelled out right there in the article.
Wow.
Admin
Admin
... it's to be the 1st poster, right?
Admin
should be:
Admin
That's the common thing to do, but the index is supposed to be [ 1 .. 6 ] not [ 0 .. 5 ] here.
Admin
The ajaxload.info site is broken - I get stuck with this crappy loading animation whenever I try to click something.
Admin
I see the WTF. They're passing a string to setTimeout. They should pass a function object, so it doesn't have to recompile the code every 200 ms:
Or, even better, they could call setInterval once and it will automatically reschedule the timer.I hate when people don't take the time to read the API documentation.
Admin
Check out http://thedailywtf.com/Articles/Technically,-Its-Still-GIF-Animation.aspx for an easy alternative to animated GIFs
Admin
I think I read something in the article that says something similar to this...
CAPTCHA: persto (damn those typos >.< )
Admin
Ah, no, the real underlying problems are much deeper than that. They're checking for the existence of one snippet of text, then building a path using part of the name, and by induction guessing the next name, then loading an image and not checking to see if it actually was there to load and it did load.
Admin
document.getElementById() ? More cycles wasted!
I particularly love that it has no exit condition. Anything that's worth doing, is worth doing FOREVER!
Admin
or use the animated gif and re-set the source of the image on submit and it'll keep going
Admin
A circular reference! :O I hope the forum's garbage collector can handle that...
Admin
Admin
TRWTF is they are using eval in the setTimeout() function. Instead of calling setTimeout("Animate()", 200) they should be calling setTimeout(Animate, 200). Oh... and using globals... and not caching the img element... and in the first version not using switch case. Maybe the original code was to support animated PNGs in a browser that still doesn't support them.
Admin
I see a lot of garbage in the comments, so I assume it's broken anyway
Admin
Is it Firefox that stops the animations? I thought I had that problem in IE but not Firefox. It has been a while though.
Admin
Be careful with the code in that link - the whole thing could have been replaced by an animated gif.
Admin
The animatied gif progress indicators... they do nothing!
-- Furry cows moo and decompress.
Admin
Cognos BI?
Admin
Or animated JPEGs! As a low-tech alternative to embedded video. 5 frames per second!
I'd agree that it's a bad idea, but probably the overhead is negligible, and modern JS implementations will optimise it away for you. Not really a WTF in itself.
I'd say TRWTF is that they're not using an array of image filenames or at least clearly defined bounds in the original version: adding a frame in the original would mean adding two lines, which probably did happen at some point. It's pretty odd that each cycle lasts exactly 6/5 of a second.
Admin
I didn't know that. I'll have to give it a try. Thanks.
Admin
Admin
Admin
Obvious troll...is obvious.
Admin
Google actually does exactly this for those little animated emoticons you get in GMail Chat. Maybe there's a reason ...?
Admin
Nice effet! Care to share the code?
Admin
Andy Goth, how did you embed the JavaScript to do that animation?
Admin
I prefer to use animated JPEGs. The compression is better and the transition more seamless.
Admin
There seems to be more WTF's in the comments then there were in the article :S
Admin
Spoiler: LightStyx is a troll the likes of which we haven't seen since TopCod3r
Admin
WTF attract WTF...
Admin
I think he just wanted to say GIMP
Admin
Im new here, should that have been "first" for second page or something?
Admin
I think you guys just invented recursive sarcasm.
Admin
Wow, the inner-platform effect strikes again! As noted, they did not handle the corner case of javascript being disabled; they should have included a noscript tag with a shockwave plugin doing a runtime rendering of the same animated image just in case.
Fixed that for you.Admin
gonna write it in pseudo html/js :
<div1 visible=true><img1> <div2 visible=false><img2> ...
var i = 1 function animate(){ if (stillBuildingReport){ div[i++].hide() div[i].show() setTimeout(animate, 200) } else { div[i].hide div[1].show } }
Admin