首要条件:添加vbscript脚本代码,如下:
1 <SCRIPT language=VBScript>
2 Dim FileList,FileListArr,TxtList,TxtListArr,LinkList,LinkArr
3 FileList = "图片1.jpg,图片2.jpg,图片3.jpg"
4 LinkList = "链接地址1,链接地址2,链接地址3"
5 TxtList = "水印文字1;水印文字2,水印文字3"
6 FileListArr = Split(FileList,",")
7 LinkArr = Split(LinkList,",")
8 TxtListArr = Split(TxtList,",")
9 Dim CanPlay
10 CanPlay = CInt(Split(Split(navigator.appVersion,";")(1)," ")(2))>5
11 Dim FilterStr
12 FilterStr = "RevealTrans(duration=2,transition=23)"
13 FilterStr = FilterStr + ";BlendTrans(duration=2)"
14 If CanPlay Then
15 FilterStr = FilterStr + ";progid:DXImageTransform.Microsoft.Fade(duration=2,overlap=0)"
16 FilterStr = FilterStr + ";progid:DXImageTransform.Microsoft.Wipe(duration=3,gradientsize=0.25,motion=reverse)"
17 Else
18 Msgbox "幻灯片播放具有多种动态图片切换效果,但此功能需要您的浏览器为IE5.5或以上版本,否则您将只能看到部分的切换效果。",64
19 End If
20 Dim FilterArr
21 FilterArr = Split(FilterStr,";")
22 Dim PlayImg_M
23 PlayImg_M = 5 * 1000
24 Dim I
25 I = 1
26 Sub ChangeImg
27 Do While FileListArr(I)=""
28 I = I + 1
29 If I>UBound(FileListArr) Then I = 0
30 Loop
31 Dim J
32 If I>UBound(FileListArr) Then I = 0
33 Randomize
34 J = Int(Rnd * (UBound(FilterArr)+1))
35 Img.style.filter = FilterArr(J)
36 Img.filters(0).Apply
37 Img.Src = FileListArr(I)
38 Img.filters(0).play
39 Link.Href = LinkArr(I)
40 I = I + 1
41 If I>UBound(FileListArr) Then I = 0
42 TempImg.Src = FileListArr(I)
43 TempLink.Href = LinkArr(I)
44 SetTimeout "ChangeImg", PlayImg_M,"VBScript"
45 End Sub
46 </SCRIPT>
其次需要在页面中进行如下代码:
1 <TABLE height="100%" cellSpacing=0 cellPadding=0 width="100%"
2 border=0>
3 <TBODY>
4 <TR id=NoScript>
5 <TD style="COLOR: white"
6 align=middle>对不起,图片浏览功能需脚本支持,但您的浏览器已经设置了禁止脚本运行。请您在浏览器设置中调整有关安全选项。</TD></TR>
7 <TR id=CanRunScript style="DISPLAY: none">
8 <TD vAlign=center align=middle height="100%"><A id=Link
9 target='_blank"' ?><IMG id=Img height=219 width=429
10 border=0></A></TD></TR>
11 <TR style="DISPLAY: none">
12 <TD><A id=TempLink target='_blank"' ?><IMG id=TempImg
13 border=0></A></TD></TR></TBODY></TABLE>
14 <SCRIPT language=VBScript>
15 NoScript.Style.Display = "none"
16 CanRunScript.Style.Display = ""
17 Img.Src = FileListArr(0)
18 Link.Href = LinkArr(0)
19 SetTimeout "ChangeImg", PlayImg_M,"VBScript"
20 </SCRIPT>
21 </P></TD></TR></TBODY></TABLE>
显示出来的效果图,会如flash制作一样的效果图,有各种各样的幻灯片效果
posted on 2006-09-05 17:02
闵毓 阅读(675)
评论(0) 编辑 收藏 所属分类:
其他