jacquie Site Admin
Joined: 31 Jan 2007 Posts: 102
Location: Salt Lake City, Utah, USA
|
Posted: Sun Feb 04, 2007 12:08 am Post subject: Updated Progress Bars |
|
|
If you use Matthew Harvey's Sweet HTML Morsels Progress Bars they will not work on the new Blogger because it is not strict XHTML which is fussier about correct tag formation than regular old HTML.
This is updated code that will work - add it as a sidebar page element.
| Code: |
<script language="javascript">
// drawPercentBar()
// Written by Matthew Harvey (matt AT unlikelywords DOT com)
// (http://www.unlikelywords.com/html-morsels/)
// Distributed under the Creative Commons
// "Attribution-NonCommercial-ShareAlike 2.0" License
// (http://creativecommons.org/licenses/by-nc-sa/2.0/)
function drawPercentBar(width, percent, color, background)
{
var pixels = width * (percent / 100);
if (!background) { background = "none"; }
document.write('<div style="position: relative; line-height: 1em; background-color: '
+ background + '; border: 1px solid black; width: '
+ width + 'px">');
document.write('<div style="height: 1.5em; width: ' + pixels + 'px; background-color: '
+ color + ';"></div>');
document.write('<div style="position: absolute; text-align: center; padding-top: .25em; width: '
+ width + 'px; top: 0; left: 0">' + percent + '%</div>');
document.write('</div>');
}
</script>
|
_________________ Jacquie
Jacquie's Journal
Crafty Threads 'n' Yarns |
|