David Bindel dbindel at austin.rr.com
Mon Aug 25 23:14:07 CDT 2003

Josh wrote:
> Jeff wrote:
>>     yeah, i think an image would weigh less than
>>     all the html and little images necessary to
>>     produce the same thing)
> I'd reccon it'd be close, but I bet that an all HTML solution
> would win out, size-wise, as a decent HTMLer could do it
> without any images.  Wouldn't be too tough to figure out, if your up
> for it. 

A couple years ago when I used use ASP, I made this website for a
competition (the link will take you to live poll results, and no, the
results are not from legitimate input, rather a bunch of friends wanting
to see the results change):

The method I used was to have a fixed width (say 300px) and make that
correspond to 100%.  Then I would perform the calculations server side
to figure out how many percent each particular poll option had and
multiply that by the fixed width.  So if 1/4 of people voted for Choice
A, the absolute width of Choice A would be 25% * 300px = 75px.

I then outputted to the page an image tag being of the absolute width
that I calculated above.  The image was a 1x1 transparent PNG, and I
nested the tag inside of a span element with a few CSS styles to set the
background color and give it a border.  Finally, I subtracted the
absolute width of that image from 300px to find the remaining unused
space, and I then outputted an image similar to the previous one, except
using a gray background to imply emptiness ("grayed out.")  Following
the 25% example in the previous paragraph, the width of the gray bar
would be 300px - 75px = 225px.

Anyways, good luck with the website, and I hope this will give you some

David Bindel

    David I. Bindel
  Website Development
 dbindel at austin.rr.com

More information about the thelist mailing list