I was reading an article on Wired which linked to various sites that showed how to make various charts in CSS with no images... none of them managed the text-changing-colour effect that's so popular (in fact the text on some of them was god awful).
I was pretty sure I could do better so I knocked up this concept!
Feel free to steal it (Credit is fine. So is cash. Arf)
I haven't even really tested this, it's just a proof of concept. Don't be shocked if it doesn't work in anything except Firefox.
The javascript is solely for the dynamicness to show it off. All the actual layouting stuff is in the CSS.
It's currently fixed width, unfortunately. I might work on that.
It uses floats and negative margins, so probably isn't very cross compatible as it stands.
Lemme know if this is cool or not. If it is I might spend some time making a decent version.
(, Fri 16 Jan 2009, 21:24, Reply)
there is an odd glitch every now and then but that might be IE 7. I reckon it's pretty cool *clicks*
(, Fri 16 Jan 2009, 21:30, Reply)
I only have IE8 here in which it fucks up royally. Standards testing this is fun, the animation and wait create suspense!
Oh, and it doesn't have the DOCTYPE thing so IE will probably not go into compliance mode.
(, Fri 16 Jan 2009, 21:36, Reply)
but at a few stages through the progress it just kind of goes "WEWWOOOOO", if you know what I mean? no? lol!
It kind of jumps down then up again if that helps.
Edit: but really quickly, just like 100ms or something.
(, Fri 16 Jan 2009, 21:44, Reply)
It makes the left hand bar wider before making the right hand one narrower. So they're getting two wide and popping out. Is it fixed now?
Also, I'm less worried about JS related issues as the animation isn't the important part.
(, Fri 16 Jan 2009, 21:52, Reply)
i've watched it a few times now and it seems that the bar gets taller, and the button adjusts to compensate the new height too, then like a flicker later it's back to normal again. And as "Thrill_My_Chinchilla" just said above, it's about 20% and 70% that it happens. Could it be some kind of weird rounding issue?
(, Fri 16 Jan 2009, 21:59, Reply)
Try this one if you have the patience, and see if you can narrow it down?
Also what browser are you using?
(, Fri 16 Jan 2009, 22:06, Reply)
I believe you've found a bug in IE7 :P
... I'll fix this for rev02
Thanks for the helpage :)
(, Fri 16 Jan 2009, 23:02, Reply)
No glitches and I clicked it a few times
(, Fri 16 Jan 2009, 21:36, Reply)
Although when the bar gets to 50% the black percentage moves to the right to stay on the pink bar. The white percentage seems to be doing what it is supposed to do though.
(, Fri 16 Jan 2009, 22:22, Reply)
I had a feeling that negative margins + overflow: hidden wouldn't go well.
(, Fri 16 Jan 2009, 22:28, Reply)
though obviously it's not what was intended.
(, Fri 16 Jan 2009, 23:13, Reply)
Where the percentage shown moves with the bar. Possible extra feature I guess!
(, Fri 16 Jan 2009, 23:35, Reply)

