不能设置属性的名称定义是怎么回事
window.onload = function(){
var bannerlr = document.getElementById('banner-lr');
var lest = document.getElementById('bann-ul');
var buttons = document.getElementById('buttons').getElementsByTagName('span');
var next = document.getElementById('banner-an');
var part = document.getElementById('banner-anr');
var index = 1;
function show(){
buttons[index - 1].className = 'on';
}
function animate(offset){
var newleft = parseInt(lest.style.left)+offset
lest.style.left = newleft+ 'px';
if(newleft < -8130){
lest.style.left = -450 + 'px';
}
if(newleft > -450){
lest.style.left = -8130 + 'px';
}
}
next.onclick = function(){
index += 1;
show();
animate(-1920)
};
part.onclick = function(){
index -=1;
show();
animate(1920)
}
}