为什么点击箭头,我的图片没有反应?js代码如下:
window.onload =function(){
//1、获取元素 catch element
var container=document.getElementById('container');
var list=document.getElementById('list');
var buttons=document.getElementById('buttons').getElementsByTagName('span');
var prev=document.getElementById('prev');
var next=document.getElementById('next');
next.onclick=function(){
list.style.left=parseInt(list.style.left)-600+'px';
console.log('yyyy');
}
prev.onclick=function(){
list.style.left=parseInt(list.style.left)+600+'px';
console.log('xxxx');
}
}