ShadowIce
06-17-2009, 10:54 PM
Hi all, I've been researching image data, and i've come to a bump in the road.
I get an undefined value when i try to scale my image and times it by a # like 2.
Here's the code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled</title>
<script type="text/javascript">
function getwidth(){
var wth;
for(i = 0; i < window.document.images.length; i++)
{
wth = window.document.images[i].width;
}
alert(wth);
return wth;
}
function getheight(){
for(i = 0; i < window.document.images.length; i++)
{
hgt = window.document.images[i].height;
}
return hgt;
}
</script>
</head>
<img width="getwidth()*2" height="getheight()*2" src="c:/xampp/htdocs/imageposeidon/images/indian.gif"/></img>
</body>
</html>
ANY help is GREATLY appreciated, any criticism is GREATLY ignored! ;)
Thanks! :)
~SI~
I get an undefined value when i try to scale my image and times it by a # like 2.
Here's the code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled</title>
<script type="text/javascript">
function getwidth(){
var wth;
for(i = 0; i < window.document.images.length; i++)
{
wth = window.document.images[i].width;
}
alert(wth);
return wth;
}
function getheight(){
for(i = 0; i < window.document.images.length; i++)
{
hgt = window.document.images[i].height;
}
return hgt;
}
</script>
</head>
<img width="getwidth()*2" height="getheight()*2" src="c:/xampp/htdocs/imageposeidon/images/indian.gif"/></img>
</body>
</html>
ANY help is GREATLY appreciated, any criticism is GREATLY ignored! ;)
Thanks! :)
~SI~