跟我学用代码做风景相册
1、准备尺寸大小相同的网上风景图片若干张(不超过28张),
2、打开文章编辑框,勾选“查看HTML源代码”,
3、将下面的源代码复制、粘贴进编辑框内,
4、用自己的图片网址替换源代码中的图片网址(红色),
5、根据图片的尺寸大小,修改源代码中图片的宽(width)和高(height)的像素值,
6、取消“查看HTML源代码”的勾,按正常编辑模式发表文章。
说明:源代码中有15张图片网址,你可根据实际情况增加或减少图片数量,图片数量不能超过28张,最下面的图片网址是相册的第一张图片网址。
源代码:
<HTML> <HEAD> <TITLE>文本特效篇--文本连续消隐</TITLE> </HEAD> <BODY bgcolor="#fef4d2" > <!-- 案例代码1开始 --> <script id=code language=JavaScript> var Ga=new Array() <!-- //定义一个变量数组Ga --> Ga[0]="http://img3.3lian.com/2006/026/32/002.jpg"; <!-- // 设置要显示的图片地址,有几张就试几个,改变下标0,1,2等等,后面则是上传图片的地址--> Ga[1]="http://img3.3lian.com/2006/026/32/003.jpg"; Ga[2]="http://img3.3lian.com/2006/026/32/007.jpg"; Ga[3]="http://img3.3lian.com/2006/026/32/006.jpg"; Ga[4]="http://img3.3lian.com/2006/026/32/010.jpg"; Ga[5]="http://img3.3lian.com/2006/026/32/014.jpg"; Ga[6]="http://img3.3lian.com/2006/026/32/015.jpg"; Ga[7]="http://img3.3lian.com/2006/026/32/018.jpg"; Ga[8]="http://img3.3lian.com/2006/026/32/017.jpg"; Ga[9]="http://img3.3lian.com/2006/026/32/019.jpg"; Ga[10]="http://img3.3lian.com/2006/026/32/026.jpg"; Ga[11]="http://img3.3lian.com/2006/026/32/009.jpg"; Ga[12]="http://img3.3lian.com/2006/026/32/008.jpg"; Ga[13]="http://img3.3lian.com/2006/026/32/004.jpg";
var hayasa=2000 <!-- //两个图片之间延迟时间,4000等于4秒 --> var suu =1; var iTransNumber=0; var garTransitions = new Array(); //arrary of filter strings garTransitions[0] = "progid:DXImageTransform.Microsoft.RandomDissolve()"; garTransitions[1] = "progid:DXImageTransform.Microsoft.Iris(irisStyle=, motion=out)"; garTransitions[2] = "progid:DXImageTransform.Microsoft.Iris(irisStyle=diamond, motion=in)"; garTransitions[3] = "progid:DXImageTransform.Microsoft.Iris(irisStyle=cross, motion=)"; garTransitions[4] = "progid:DXImageTransform.Microsoft.Iris(irisStyle=circle, motion=)"; garTransitions[5] = "progid:DXImageTransform.Microsoft.Iris(irisStyle=square, motion=out)"; garTransitions[6] = "progid:DXImageTransform.Microsoft.Iris(irisStyle=plus, motion=in)"; garTransitions[7] = "progid:DXImageTransform.Microsoft.Barn(orientation=vertial motion=in)"; garTransitions[8] = "progid:DXImageTransform.Microsoft.Barn(orientation=vertial motion=out)"; garTransitions[9] = "progid:DXImageTransform.Microsoft.Barn(orientation=horizontal motion=in)"; garTransitions[10] = "progid:DXImageTransform.Microsoft.Barn(orientation=horizontalmotion=out)"; garTransitions[11] = "progid:DXImageTransform.Microsoft.Pixelate()"; garTransitions[12] = "progid:DXImageTransform.Microsoft.Inset()"; garTransitions[13] = "progid:DXImageTransform.Microsoft.Checkerboard(Direction=left)"; garTransitions[14] = "progid:DXImageTransform.Microsoft.Checkerboard(Direction=right)"; garTransitions[15] = "progid:DXImageTransform.Microsoft.Checkerboard(Direction=down)"; garTransitions[16] = "progid:DXImageTransform.Microsoft.Checkerboard(Direction=up)"; garTransitions[17] = "progid:DXImageTransform.Microsoft.RandomBars(motion=horizontal)"; garTransitions[18] = "progid:DXImageTransform.Microsoft.RandomBars(motion=vertical)"; garTransitions[19] = "progid:DXImageTransform.Microsoft.Slide(bands=5, slideStyle=push)"; garTransitions[20] = "progid:DXImageTransform.Microsoft.Slide(bands=5, slidestyle=swap)"; garTransitions[21] = "progid:DXImageTransform.Microsoft.Slide(bands=5, slidestyle=hide)"; garTransitions[22] = "progid:DXImageTransform.Microsoft.Spiral()"; garTransitions[23] = "progid:DXImageTransform.Microsoft.Stretch(stretchStyle=push)"; garTransitions[24] = "progid:DXImageTransform.Microsoft.Stretch(stretchStyle=pop)"; garTransitions[25] = "progid:DXImageTransform.Microsoft.Fade(duration=2,overlap=0)"; garTransitions[26] = "progid:DXImageTransform.Microsoft.GradientWipe(duration=2,gradientSize=0.25,motion=forward )"; garTransitions[27] = "progid:DXImageTransform.Microsoft.Wheel(duration=2,spokes=16)"; garTransitions[28] = "progid:DXImageTransform.Microsoft.RadialWipe(duration=2,wipeStyle=CLOCK)"; var kirikaeGa=new Array() for (kazu=0;kazu<Ga.length;kazu++){ kirikaeGa[kazu]=new Image() kirikaeGa[kazu].src=Ga[kazu]} function kirikae(){ if (window.createPopup) rittai.style.filter = garTransitions[iTransNumber]; iTransNumber++; if(iTransNumber==garTransitions.length) iTransNumber=0; if (window.createPopup) rittai.filters[0].apply(); document.images.rittai.src=kirikaeGa[suu].src; if (window.createPopup) rittai.filters[0].play() suu++ if (suu==kirikaeGa.length) suu=0; setTimeout("kirikae()",hayasa) } setTimeout("kirikae()",hayasa)
</script> <center><img src="http://img3.3lian.com/2006/026/32/001.jpg" name="rittai" width=614 height=461 border=0 style="filter:progid:DXImageTransform.Microsoft.Stretch(stretchStyle=)"> </center> <!-- //显示图片的方式,src=后面一般是第一张图片,宽度,高度位置都可以按html方法去设置 --><BGSOUND balance=0 src="http://www.hkedcity.net/iclub_files/a/1/95/webpage/midi/NAME.MID" volume=-240 loop=infinite> </HTML>
|