图片自动切换???
我想实现让几张图片每隔一段时间就切换一下,
如每隔10秒钟就显示下一张,然后循环
图片的路径存在数据库里面
有点像幻灯片的效果
,用asp实现,或者谁有更好的方法?高分重赏!
------解决方案-------------------- <script language=JavaScript>
var imgUrl=new Array();
var imgLink=new Array();
var adNum=0;
imgUrl[1]= "200702081706558759.jpg ";
imgLink[1]= "info_view.asp?infoid=208618 ";
imgUrl[2]= "200702081705467648.jpg ";
imgLink[2]= "infoid=208161 ";
imgUrl[3]= "200702081705004315.jpg ";
imgLink[3]= "infoid=208415 ";
imgUrl[4]= "200702081701427748.jpg ";
imgLink[4]= "info_view.asp?infoid=208688 ";
var imgPre=new Array();
var y=0;
for (i=1;i <=4;i++) {
if( (imgUrl[i]!= " ") && (imgLink[i]!= " ") ) {
y++;}
else {break;}
}
function playTran(){
if (document.all)
imgInit.filters.revealTrans.Transition=23;
imgInit.filters.revealTrans.play();
}
var key=0;
function nextAd(){
if(adNum <y)adNum++ ;
else adNum=1;
if( key==0 ){
key=1;
} else if (document.all){
imgInit.filters.revealTrans.Transition=23;
imgInit.filters.revealTrans.apply();
playTran();
}
document.images.imgInit.src=imgUrl[adNum];
theTimer=setTimeout( 'nextAd() ', 6000);
}
function goUrl(){
jumpUrl=imgLink[adNum];
jumpTarget= '_blank ';
if (jumpUrl != ' '){
if (jumpTarget != ' ')
window.open(jumpUrl,jumpTarget);
else
location.href=jumpUrl;
}}
</script>
<a href= 'javascript:goUrl() '> <img style= 'FILTER: revealTrans(duration=2,transition=23); border:1px solid #333 ' src= 'javascript:nextAd() ' width= '198 ' height= '140 ' name= 'imgInit ' border= '0 '> </a>
------解决方案-------------------- <script language=JavaScript>
var imgUrl=new Array();
var imgLink=new Array();
var adNum=0;
imgUrl[1]= "http://htx.12edu.cn/files/infor/20050713105049/nu572HIp.jpg ";
imgLink[1]= "/default.asp ";
imgUrl[2]= "http://htx.12edu.cn/files/infor/20050715175902/JO3l1cLO.gif ";
imgLink[2]= "/default.asp ";
imgUrl[3]= "http://htx.12edu.cn/files/infor/20050720152330/X4PL8f9j.jpg ";
imgLink[3]= "/default.asp ";
imgUrl[4]= "http://htx.12edu.cn/files/infor/20050720152808/6qJ7ECCM.jpg ";
imgLink[4]= "/default.asp ";
imgUrl[5]= "http://htx.12edu.cn/files/infor/20050523152246/O9lkn21n.jpg ";
imgLink[5]= "/default.asp ";
var imgPre=new Array();
var j=0;
for (i=1;i <=5;i++) {
if( (imgUrl[i]!= " ") && (imgLink[i]!= " ") ) {
j++;
} else {
break;
}
}
function playTran(){
if (document.all)
imgInit.filters.revealTrans.play();
}
var key=0;
function nextAd(){
if(adNum <j)adNum++ ;
else adNum=1;
if( key==0 ){
key=1;
} else if (document.all){
imgInit.filters.revealTrans.Transition=6;
imgInit.filters.revealTrans.apply();
playTran();
}
document.images.imgInit.src=imgUrl[adNum];
theTimer=setTimeout( "nextAd() ", 5000);
}
function goUrl(){
jumpUrl=imgLink[adNum];
jumpTarget= '_self ';
if (jumpUrl != '