只要在原来代码的基础上添加键盘检测事件就可以了啊。具体方法是,在原来js代码的handleEvent函数中,添加如下代码:
this.addEvent(document, 'keyup', function(e) {
var currKey = 0,e = e || event;
currKey = e.keyCode || e.which || e.charCode;
if(currKey == 37){
that.fnPrev();
} else if(currKey == 39){
that.autoPlay();
}
});
chrome,firefox测试没问题