I need to create a thermometer type widget for a website, where I can feed in a goal and current amount, then generate a graphic that shows the progress. I was thinking something with jQuery/CSS would be the best approach, but then I started thinking maybe just using a vertical slider from the jQuery UI library and skinning it. How would you all approach this? I've looked for a plugin but haven't come across anything relevant.
+2
A:
You can make the indicator by a simple div with background
image, positioned by JS.
- create a div
- set the height / width
- set a bg image
- calculate the position of the bg image based on the values
- set the
background-position
css property form the result
Makram Saleh
2010-08-04 06:19:28
Went ahead with this method and it worked perfectly. Thanks!
Bradley Herman
2010-08-08 04:18:11
Great! It'll be helpful for all of us if you can share your code here.
Makram Saleh
2010-08-08 07:13:39