3D旋转的立方体特效代码 dn001 2009-06-21 08:54:03 <!--把下列代码加到body区域内--> <SCRIPT language="JavaScript" type="text/javascript"> //more javascript from http://www.knowsky.com var wdmax=120; var wdmin=0; var inc=5; var rate = 50; var pause = 1000; var ff="flip"; function flipflop() { if (ff=="flip") { var wd = pic.width; wd = wd - inc; pic.width=wd; if (wd==wdmin) { pic.src="http://img.pc004.com/p/2009-06-21/20090621085403394.gif"; inc=-inc; } if (wd==wdmax) { ff="flop"; inc=-inc; setTimeout("flipflop()",pause); } else { setTimeout("flipflop()",rate); } } else { var ht = pic.height; ht = ht - inc; pic.height=ht; if (ht==wdmin) { pic.src="http://img.pc004.com/p/2009-06-21/20090621085403394.gif"; inc=-inc; } if (ht==wdmax) { ff="flip"; inc=-inc; setTimeout("flipflop()",pause); } else { setTimeout("flipflop()",rate); } } } --> </SCRIPT> <center> <body onLoad="javascript:flipflop()"> <TABLE border="0"> <th width="160" height="160"> <IMG src="http://img.pc004.com/p/2009-06-21/20090621085403394.gif" width="120" height="120" ID="pic"> </th></TABLE>