把一张图片变形扭曲成各种不同的长宽

第一步:把如下代码加入

 1<body>区域中   
 2<img alt="很好玩的" border="0" name="u" src="http://my.6to23.com/redriver/helpor/helpor.gif"/>
 3<script language="JavaScript">   
 4  
 5var b = 1;   
 6var c = true;   
 7  
 8function fade(){   
 9if(document.all);   
10  
11if(c == true) {   
12b++;   
13}   
14if(b==100) {   
15b--;   
16c = false   
17}   
18  
19if(b==10) {   
20b++;   
21c = true;   
22}   
23  
24if(c == false) {   
25b--;   
26}   
27u.width=150 + b;   
28u.height=125 - b;   
29setTimeout("fade()",50);   
30}   
31</script>   
32  
33  
34第二步:把<body>区域中改为   
35<body bgcolor="#fef4d9" onload="fade()"></body></body></body>
Published At
Categories with Web编程
Tagged with
comments powered by Disqus