HTML section
<a href= "" id= "PTA" ><div id= "Picture" Class= "PT" ></div></a>a label wrapped Div, background image as a link
Script section
var n=-1;//n is placed outside as a global variable, otherwise the value of N is 1 per flush
Function pt () {
var tp=new Array (' url (.. /bank/picture/1111.jpg) ', ' url (.. /bank/picture/2222.jpg) ', ' url (.. /bank/picture/3333.jpg) ', ' url (.. /bank/picture/4444.jpg) ')
var adiv=new Array (' http://www.bankofchina.com/pbservice/bi3/201701/t20170124_8524721.html ', '/HTTP/ www.bankofchina.com/pbservice/pb7/', ' http://www.bankofchina.com/pbservice/pb8/', ' http://www.bankofchina.com/ cbservice/cb11/')
var Picture=document.getelementbyid (' picture ')
var Pta=document.getelementbyid (' PTA ')
N+=1
E=n%tp.length;
Pta.setattribute (' href ', adiv[e])
Picture.style.background=tp[e]
SetTimeout (' pt () ', 3000)
}
PT ()
JS Picture Carousel