DanForte
07-01-2005, 04:20 PM
hey everyone, This code here allows you to alter the size of a horizontal bar however I want it to change the size using an image. any ideas?
<script Language="JavaScript">
<!--- Hide script from old browsers
// This function displays a horizontal bar of specified width
function bar( widthPct )
{
document.write( "<HR ALIGN='left' WIDTH=" + widthPct + "%>" );
}
// end script hiding from old browsers -->
</script>
<script>
<!--- hide script
bar(25); // <----- Allows alteration of the horizontal bar
</script>
I know it would be easier just to declare the specs of the pic in html, but the course I'm in wants me to alter this javascript to change the size. :rolleyes:
<script Language="JavaScript">
<!--- Hide script from old browsers
// This function displays a horizontal bar of specified width
function bar( widthPct )
{
document.write( "<HR ALIGN='left' WIDTH=" + widthPct + "%>" );
}
// end script hiding from old browsers -->
</script>
<script>
<!--- hide script
bar(25); // <----- Allows alteration of the horizontal bar
</script>
I know it would be easier just to declare the specs of the pic in html, but the course I'm in wants me to alter this javascript to change the size. :rolleyes: