jobo: Bildbreite dynamisch ändern??

Beitrag lesen

Hallo,

  
<img src="test.jpg" width="50px">  
<script>  
myImg = document.getElementsByTagName("img")[0];  
growingWidth = 50;  
enlarge = function () {  
	 growingWidth += 1;  
	if (growingWidth == 51) {  
		alert("starting");  
	}	  
	if (growingWidth < 300) {  
		myImg.style.width =  growingWidth + "px";  
		setTimeout("enlarge()", 100);  
	}	  
}  
</script>  
<button onclick="enlarge()">enlarge</button>  

funzt.

Gruß

jobo