以下是js代码,我测试了,还不错
- <div id="divs">
- <img src="p_w_picpaths/flash1.jpg" id="1" style="FILTER: revealTrans(duration=1,transition=16); cursor:pointer;" onclick="location.href = '#'">
- <img src="p_w_picpaths/flash2.jpg" id="2" style="FILTER: revealTrans(duration=1,transition=17); cursor:pointer;display:none" onclick="location.href = '#'">
- <img src="p_w_picpaths/flash3.jpg" id="3" style="FILTER: revealTrans(duration=1,transition=18); cursor:pointer;display:none" onclick="location.href = '#'">
- <img src="p_w_picpaths/flash4.jpg" id="4" style="FILTER: revealTrans(duration=1,transition=19); cursor:pointer;display:none" onclick="location.href = '#'">
- <img src="p_w_picpaths/flash5.jpg" id="5" style="FILTER: revealTrans(duration=1,transition=20); cursor:pointer;display:none" onclick="location.href = '#'">
- <img src="p_w_picpaths/flash6.jpg" id="6" style="FILTER: revealTrans(duration=1,transition=21); cursor:pointer;display:none" onclick="location.href = '#'">
- </div>
- <script language="javascript">
- function $(_sId) {
- return document.getElementById(_sId);
- }
- var speed=5000;
- var setid=null;
- var auto="true";
- function galleryplay(divs,a,mtime){ //t为要应用此函数的id,a初始化时显示的项目的顺序数
- if(divs=="0")return false;
- var start=3;
- if(auto=="true")
- {
- start = a-1;//初始项目
- speed = mtime;//切换间隔
- setid = null;//定时器
- var loop = function(){ //自动切换
- ids = divs.split(",");
- for (var i=0;i<ids.length; i++)
- {
- $(ids[i]).style.display='none';
- }
- $(ids[start]).filters.revealTrans.Transition = Math.floor(Math.random() * 23);
- $(ids[start]).filters.revealTrans.apply();
- $(ids[start]).filters.revealTrans.play();
- $(ids[start]).style.display='';
- setid=setTimeout(loop,speed);
- start++;
- if(start==ids.length){
- start=0;
- }
- };loop();
- }
- }
- galleryplay('1,2,3,4,5,6',1,5000);
- </script>
















