jq简单选项卡

function tabControl(obj,elm){
    $(obj).hover(function(){

        $(this).addClass('active').siblings().removeClass('active');
    //获取当前点击的索引
        var index = $(this).index();
    //元素的选择是当前点击的索引值
        $(elm).eq(index).show().siblings().hide();
    })
}
tabControl('.activity-main .activity-main-nav a','.activity-main .show1')
全部教程http://each.sinaapp.com/angular/index.html
原文地址:https://www.cnblogs.com/xfdmb/p/6186714.html