如何使这些广告图片,可以有后台添加,让他可以更新,而不是需要dw来更改。
下面的代码是一个图片的轮换的代码,我的问题是:如何实现这些图片都是来自数据库的,也就是说如何实现这些图片都可以用数据库来更新,rs记录如何插入到其中。请高手指教下,我比较菜,
<SCRIPT language=JavaScript>
<!-- // BannerAD
var bannerAD=new Array();
var bannerADlink=new Array();
var adNum=0;
bannerAD[0]= "goodpic/ZXX-045.jpg ";
bannerADlink[0]= "goodpic/ZXX-045.jpg ";
bannerAD[1]= "goodpic/ZXX-012.jpg ";
bannerADlink[1]= "goodpic/ZXX-012.jpg ";
bannerAD[2]= "goodpic/ZXX-018.jpg ";
bannerADlink[2]= "goodpic/ZXX-018.jpg ";
bannerAD[3]= "goodpic/ZXX-019.jpg ";
bannerADlink[3]= "goodpic/ZXX-019.jpg ";
var preloadedimages=new Array();
for (i=1;i <bannerAD.length;i++){
preloadedimages[i]=new Image();
preloadedimages[i].src=bannerAD[i];
}
function setTransition(){
if (document.all){
bannerADrotator.filters.revealTrans.Transition=Math.floor(Math.random()*23);
bannerADrotator.filters.revealTrans.apply();
}
}
function playTransition(){
if (document.all)
bannerADrotator.filters.revealTrans.play()
}
function nextAd(){
if(adNum <bannerAD.length-1)adNum++ ;
else adNum=0;
setTransition();
document.images.bannerADrotator.src=bannerAD[adNum];
playTransition();
theTimer=setTimeout( "nextAd() ", 5000);
}
function jump2url(){
jumpUrl=bannerADlink[adNum];
jumpTarget= '_blank ';
if (jumpUrl != ' '){
if (jumpTarget != ' ')window.open(jumpUrl,jumpTarget);
else location.href=jumpUrl;
}
}
function displayStatusMsg() {
status=bannerADlink[adNum];
document.returnValue = true;
}
//-->
</SCRIPT> <table width= "200 " height= "200 " border=0 align= "center "
cellpadding=0 cellspacing=0 bordercolor=#111111 style= "BORDER-COLLAPSE: collapse ">
<tbody>
<tr>
<td width= "219 " height= "160 " align= "left " valign= "top "> <a onMouseOver= "displayStatusMsg();return document.returnValue " href= "javascript:jump2url() ">
<img
style= "FILTER: revealTrans(duration=2,transition=20) " height=200
src= " " width=200 border=0
name=bannerADrotator>