今天和大家简单介绍一下table的轮播的自动切换 ``` * { padding: 0; margin: 0; } .one { width: 500px; margin: 0 auto; } .tabHead li { float: left; width: 60px; background: skyblue; color: snow; list-style-type: none; text-align: center; height: 30px; line-height: 30px; }
.tabHead li.active {
background: #55a532;
}
.clear {
clear: both;
}
.tabList {
font-size: 0px;
position: relative;
height: 300px;
width: 300px;
background: #ccffaa;
overflow: hidden;
}
.tabList div {
height: 300px;
width: 300px;
font-size: 14px;
position: absolute;
}
js内容
$(function () {
// 初始的时候的当前处于活动状态的元素索引
var current = $('.tabHead li.active').index();
$('.tabList div').each(f