pman
05-23-2007, 03:04 AM
Hi there,
I just googling about reference of Javascript Image object and found the following site as the first result.
http://www.comptechdoc.org/independent/web/cgi/javamanual/javaimage.html
It says that height and width is read only. Isn't that a mistake? I think I have seen couple of other sites that mentioned those two properties as read only value.
I was able to do the following and change the height and width value, which worked perfectly fine.
var myImg = new Image() ;
myImg.src = "http://www.cortland.edu/flteach/mm-course/forms1.jpg" ;
alert(myImg.height) ; alert(myImg.width) ;
myImg.height = 500 ;
myImg.width = 600 ;
document.getElementById('imageTest').appendChild(myImg) ;
______________________
Regards
Pman
http://www.pmansLab.com
I just googling about reference of Javascript Image object and found the following site as the first result.
http://www.comptechdoc.org/independent/web/cgi/javamanual/javaimage.html
It says that height and width is read only. Isn't that a mistake? I think I have seen couple of other sites that mentioned those two properties as read only value.
I was able to do the following and change the height and width value, which worked perfectly fine.
var myImg = new Image() ;
myImg.src = "http://www.cortland.edu/flteach/mm-course/forms1.jpg" ;
alert(myImg.height) ; alert(myImg.width) ;
myImg.height = 500 ;
myImg.width = 600 ;
document.getElementById('imageTest').appendChild(myImg) ;
______________________
Regards
Pman
http://www.pmansLab.com