日期:2014-05-16 浏览次数:20722 次
function switchBanner(event) {
$.each(banners,
function(index, element) {
$(element).toggle()
})
}
var index = 0;
function switchBanner(event) {//假设参数event为前进或者后台指令
banners[index].hide(); //隐藏当前显示的
if (event == 'prev') index--;
else index++;
if (index < 0) index = banners.length - 1;
else if (index >= banners.length) index = 0;
banners[index].show(); //显示下一张
}