VBscript超强幻灯片效果代码

 1<html>
 2<head>
 3<title>幻灯片播放</title>
 4<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
 5<link href="Images/Style.css" rel="stylesheet"/>
 6</head>
 7<script language="VBScript">   
 8  
 9Dim FileList,FileListArr   
10FileList = "001.jpg,002.jpg,003.jpg,004.jpg,005.jpg,006.jpg,007.jpg,008.jpg"   
11FileListArr = Split(FileList,",")   
12  
13Dim CanPlay   
14CanPlay = CInt(Split(Split(navigator.appVersion,";")(1)," ")(2))>5   
15  
16Dim FilterStr   
17FilterStr = "RevealTrans(duration=2,transition=23)"   
18FilterStr = FilterStr + ";BlendTrans(duration=2)"   
19  
20If CanPlay Then   
21FilterStr = FilterStr + ";progid:DXImageTransform.Microsoft.Pixelate(,enabled=false,duration=2,maxSquare=25)"   
22FilterStr = FilterStr + ";progid:DXImageTransform.Microsoft.Fade(duration=2,overlap=0)"   
23FilterStr = FilterStr + ";progid:DXImageTransform.Microsoft.GradientWipe(duration=2,gradientSize=0.25,motion=forward )"   
24FilterStr = FilterStr + ";progid:DXImageTransform.Microsoft.Stretch(duration=2,stretchStyle=PUSH)"   
25FilterStr = FilterStr + ";progid:DXImageTransform.Microsoft.Wheel(duration=2,spokes=16)"   
26FilterStr = FilterStr + ";progid:DXImageTransform.Microsoft.RandomDissolve(duration=2)"   
27FilterStr = FilterStr + ";progid:DXImageTransform.Microsoft.Spiral(duration=2,gridSizeX=50,gridSizeY=50)"   
28FilterStr = FilterStr + ";progid:DXImageTransform.Microsoft.Slide(duration=2,bands=1,slideStyle=SWAP)"   
29FilterStr = FilterStr + ";progid:DXImageTransform.Microsoft.RadialWipe(duration=2,wipeStyle=CLOCK)"   
30Else   
31Msgbox "幻灯片播放具有多种动态图片切换效果,但此功能需要您的浏览器为IE5.5或以上版本,否则您将只能看到部分的切换效果。",64   
32End If 
33
34Dim FilterArr   
35FilterArr = Split(FilterStr,";") 
36
37Dim PlayImg_M   
38PlayImg_M = 5 * 1000 '切换时间(毫秒) 
39
40Dim I   
41I = 1 
42
43Sub ChangeImg   
44Do While FileListArr(I)=""   
45I = I + 1   
46If I>UBound(FileListArr) Then I = 0   
47Loop   
48Dim J   
49If I>UBound(FileListArr) Then I = 0   
50Randomize   
51J = Int(Rnd * (UBound(FilterArr)+1))   
52Img.style.filter = FilterArr(J)   
53Img.filters(0).Apply   
54Img.Src = FileListArr(I)   
55Img.filters(0).play   
56I = I + 1   
57If I>UBound(FileListArr) Then I = 0   
58TempImg.Src = FileListArr(I)   
59  
60SetTimeout "ChangeImg",PlayImg_M   
61End Sub   
62</script>
63<body bgcolor="#000000">
64<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
65<tr id="NoScript">
66<td align="Center" style="Color:White">对不起,图片浏览功能需脚本支持,但您的浏览器已经设置了禁止脚本运行。请您在浏览器设置中调整有关安全选项。</td>
67</tr>
68<tr id="CanRunScript" style="Display:none">
69<td align="Center" height="100%" valign="Center">
70<img border="0" id="Img"/>
71</td>
72</tr>
73<tr style="Display:none">
74<td><img border="0" id="TempImg"/></td>
75</tr>
76</table>
77<script language="VBScript">   
78NoScript.Style.Display = "none"   
79CanRunScript.Style.Display = ""   
80Img.Src = FileListArr(0)   
81SetTimeout "ChangeImg", PlayImg_M   
82</script></body></html>
Published At
Categories with 网页设计
Tagged with
comments powered by Disqus