如何让轮播图可以上下切换图片
function one (type){
document.getElementById("a").innerHTML ='<img src="img/'+type+'">'
}
var d = 5;
function two (type){
document.getElementById("a").innerHTML = '<img src="img/'+d+'.jpg">';
if(type=='shang'){
d--;
if(d==0){d=5;}
}else if(type == 'xia'){
d++;
if(d==6){d=1;}
}
}
window.onload = function(){
setInterval(
function(){
document.getElementById("a").innerHTML = '<img src="img/'+d+'.jpg">';
d++;
if(d==6){d=1;}
},
4000
)
}