PDA

View Full Version : Changing Image Size w/ Java


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:

_Aerospace_Eng_
07-01-2005, 04:29 PM
Sorry we can't really give you the solution to this. http://www.codingforums.com/showthread.php?t=53446 Most we can do is look at code that you have attempted. We aren't going to do YOUR hw for you. Read the linked thread. One other thing Java is NOT Javascript don't confuse them.

JamieR
07-01-2005, 04:40 PM
Java and Javascript are totally different things.....learn that.

nikkiH
07-01-2005, 04:42 PM
I'll give you a hint, though.

<p>Click on the image to change the size: <img src="XXX" onclick="XXX"></p>

Now, you figure out what goes in where there is XXX... ;)