待引入的Javascript
Code
var TopNum=0;
var imgPre=new Array();
var Topcount=0;
for (i=1;i<=5;i++) {
if( (TopimgUrl[i]!="") && (TopimgLink[i]!="") ) {
Topcount++;
} else {
break;
}
}
function TopplayTran(){
if (document.all)
document.getElementById("AdInit").filters.revealTrans.play();
}
var key=0;
function TopnextAd(){
if(TopNum<Topcount)TopNum++ ;
else TopNum=1;
if( key==0 ){
key=1;
} else if (document.all){
document.getElementById("AdInit").filters.revealTrans.Transition=23;
document.getElementById("AdInit").filters.revealTrans.apply();
TopplayTran();
}
document.getElementById("AdInit").src=TopimgUrl[TopNum];
document.getElementById("focuscount").innerHTML=TopNum;
//document.getElementById("focustext").innerHTML="<a href="+TopimgLink[adNum]+" target=_blank>"+Topimgtext[adNum]+"</a>";
setTimeout("TopnextAd()", 5000); //控制时间
}
function TopnextAd2(){
if(TopNum<Topcount)TopNum++ ;
else TopNum=1;
if( key==0 ){
key=1;
} else if (document.all){
document.getElementById("AdInit").filters.revealTrans.Transition=23;
document.getElementById("AdInit").filters.revealTrans.apply();
TopplayTran();
}
document.getElementById("AdInit").src=TopimgUrl[TopNum];
document.getElementById("focuscount").innerHTML=TopNum;
//document.getElementById("focustext").innerHTML="<a href="+TopimgLink[adNum]+" target=_blank>"+Topimgtext[adNum]+"</a>";
}
function TopprondAd(){
if(TopNum>1)TopNum-- ;
else TopNum=5;
if( key==0 ){
key=1;
} else if (document.all){
document.getElementById("AdInit").filters.revealTrans.apply();
document.getElementById("AdInit").filters.revealTrans.Transition=23;
TopplayTran();
}
document.images.AdInit.src=TopimgUrl[TopNum];
document.getElementById("focuscount").innerHTML=TopNum;
//document.getElementById("focustext").innerHTML="<a href="+TopimgLink[adNum]+" target=_blank>"+Topimgtext[adNum]+"</a>";
}
function TopgoUrl(){
window.open(TopimgLink[TopNum],'_blank');
}
var TopNum=0;
var imgPre=new Array();
var Topcount=0;
for (i=1;i<=5;i++) {
if( (TopimgUrl[i]!="") && (TopimgLink[i]!="") ) {
Topcount++;
} else {
break;
}
}
function TopplayTran(){
if (document.all)
document.getElementById("AdInit").filters.revealTrans.play();
}
var key=0;
function TopnextAd(){
if(TopNum<Topcount)TopNum++ ;
else TopNum=1;
if( key==0 ){
key=1;
} else if (document.all){
document.getElementById("AdInit").filters.revealTrans.Transition=23;
document.getElementById("AdInit").filters.revealTrans.apply();
TopplayTran();
}
document.getElementById("AdInit").src=TopimgUrl[TopNum];
document.getElementById("focuscount").innerHTML=TopNum;
//document.getElementById("focustext").innerHTML="<a href="+TopimgLink[adNum]+" target=_blank>"+Topimgtext[adNum]+"</a>";
setTimeout("TopnextAd()", 5000); //控制时间
}
function TopnextAd2(){
if(TopNum<Topcount)TopNum++ ;
else TopNum=1;
if( key==0 ){
key=1;
} else if (document.all){
document.getElementById("AdInit").filters.revealTrans.Transition=23;
document.getElementById("AdInit").filters.revealTrans.apply();
TopplayTran();
}
document.getElementById("AdInit").src=TopimgUrl[TopNum];
document.getElementById("focuscount").innerHTML=TopNum;
//document.getElementById("focustext").innerHTML="<a href="+TopimgLink[adNum]+" target=_blank>"+Topimgtext[adNum]+"</a>";
}
function TopprondAd(){
if(TopNum>1)TopNum-- ;
else TopNum=5;
if( key==0 ){
key=1;
} else if (document.all){
document.getElementById("AdInit").filters.revealTrans.apply();
document.getElementById("AdInit").filters.revealTrans.Transition=23;
TopplayTran();
}
document.images.AdInit.src=TopimgUrl[TopNum];
document.getElementById("focuscount").innerHTML=TopNum;
//document.getElementById("focustext").innerHTML="<a href="+TopimgLink[adNum]+" target=_blank>"+Topimgtext[adNum]+"</a>";
}
function TopgoUrl(){
window.open(TopimgLink[TopNum],'_blank');
}
前台代码:
Code
<script type="text/javascript" language="javascript">
var TopimgUrl=new Array();
var TopimgLink=new Array();
var Topimgtext=new Array();
</script>
<script language="javascript" type="text/javascript" src="/js/ForcePic.js"></script>
<div class="focus">
<a href="javascript:TopgoUrl()"><img alt="" style="FILTER: revealTrans(duration=1,transition=5);border-color:black;color:#000000" src="javascript:TopnextAd()" width="393" height="196" name="AdInit" id="AdInit" class="ForcePic" /></a>
<div class="Forcectrl">
<div class="Forceright"><span id="focuscount">0</span>/5<a href="javascript:TopprondAd()"><img alt="" src="/images/force_left.jpg" width="20" height="19" /></a><a href="javascript:TopnextAd2()"><img src="/images/force_right.jpg" width="20" height="19" /></a></div>
<div class="indexContent_flashZ"><a href="/newscenter/SlideList.aspx" target="_blank"><img src="/images/lightcity_button01.jpg" width="36" height="19" alt="幻灯" title="幻灯" /></a> <a href="/Newscenter/ListByType.aspx?type=2" target="_blank"><img src="/images/lightcity_button02.jpg" width="36" height="19" alt="视频" title="视频" /></a> <a href="/Newscenter/ListByType.aspx?type=3" target="_blank"><img src="/images/lightcity_button03.jpg" width="36" height="19" alt="图片" title="图片" /></a> <a href="/Newscenter/ListByType.aspx?type=4" target="_blank"><img src="/images/lightcity_button04.jpg" width="36" height="19" alt="头条" title="头条" /></a> <a href="/Newscenter/ListByType.aspx?type=5" target="_blank"><img src="/images/lightcity_button05.jpg" width="36" height="19" alt="热点" title="热点" /></a></div>
</div>
</div>
<script language="javascript" type="text/javascript">
TopimgUrl[1]="http://192.168.0.101:7010/Panel/8b12c1e9-e566-4240-bc70-ca6a9cb26f3b.jpg";
Topimgtext[1]="Force1";
TopimgLink[1]="URL1";
TopimgUrl[2]="http://192.168.0.101:7010/Panel/76cd0bf7-7ca0-487f-9f68-c9f6dea7d85e.jpg";
Topimgtext[2]="Force2";
TopimgLink[2]="URL2";
TopimgUrl[3]="http://192.168.0.101:7010/Panel/5ff20a26-4e54-4e61-bee5-899e4bfa9514.jpg";
Topimgtext[3]="Force3";
TopimgLink[3]="URL3";
TopimgUrl[4]="http://192.168.0.101:7010/Panel/ee9903c7-fba9-489c-9275-ae034cbdf67e.jpg";
Topimgtext[4]="Force4";
TopimgLink[4]="URL4";
TopimgUrl[5]="http://192.168.0.101:7010/Panel/bc8b1b28-a60d-4b71-9759-ba5755f8e7cf.jpg";
Topimgtext[5]="Force5";
TopimgLink[5]="URL5";
TopnextAd();
</script>
<script type="text/javascript" language="javascript">
var TopimgUrl=new Array();
var TopimgLink=new Array();
var Topimgtext=new Array();
</script>
<script language="javascript" type="text/javascript" src="/js/ForcePic.js"></script>
<div class="focus">
<a href="javascript:TopgoUrl()"><img alt="" style="FILTER: revealTrans(duration=1,transition=5);border-color:black;color:#000000" src="javascript:TopnextAd()" width="393" height="196" name="AdInit" id="AdInit" class="ForcePic" /></a>
<div class="Forcectrl">
<div class="Forceright"><span id="focuscount">0</span>/5<a href="javascript:TopprondAd()"><img alt="" src="/images/force_left.jpg" width="20" height="19" /></a><a href="javascript:TopnextAd2()"><img src="/images/force_right.jpg" width="20" height="19" /></a></div>
<div class="indexContent_flashZ"><a href="/newscenter/SlideList.aspx" target="_blank"><img src="/images/lightcity_button01.jpg" width="36" height="19" alt="幻灯" title="幻灯" /></a> <a href="/Newscenter/ListByType.aspx?type=2" target="_blank"><img src="/images/lightcity_button02.jpg" width="36" height="19" alt="视频" title="视频" /></a> <a href="/Newscenter/ListByType.aspx?type=3" target="_blank"><img src="/images/lightcity_button03.jpg" width="36" height="19" alt="图片" title="图片" /></a> <a href="/Newscenter/ListByType.aspx?type=4" target="_blank"><img src="/images/lightcity_button04.jpg" width="36" height="19" alt="头条" title="头条" /></a> <a href="/Newscenter/ListByType.aspx?type=5" target="_blank"><img src="/images/lightcity_button05.jpg" width="36" height="19" alt="热点" title="热点" /></a></div>
</div>
</div>
<script language="javascript" type="text/javascript">
TopimgUrl[1]="http://192.168.0.101:7010/Panel/8b12c1e9-e566-4240-bc70-ca6a9cb26f3b.jpg";
Topimgtext[1]="Force1";
TopimgLink[1]="URL1";
TopimgUrl[2]="http://192.168.0.101:7010/Panel/76cd0bf7-7ca0-487f-9f68-c9f6dea7d85e.jpg";
Topimgtext[2]="Force2";
TopimgLink[2]="URL2";
TopimgUrl[3]="http://192.168.0.101:7010/Panel/5ff20a26-4e54-4e61-bee5-899e4bfa9514.jpg";
Topimgtext[3]="Force3";
TopimgLink[3]="URL3";
TopimgUrl[4]="http://192.168.0.101:7010/Panel/ee9903c7-fba9-489c-9275-ae034cbdf67e.jpg";
Topimgtext[4]="Force4";
TopimgLink[4]="URL4";
TopimgUrl[5]="http://192.168.0.101:7010/Panel/bc8b1b28-a60d-4b71-9759-ba5755f8e7cf.jpg";
Topimgtext[5]="Force5";
TopimgLink[5]="URL5";
TopnextAd();
</script>