Jquery实现Tab页效果

JS内容:
$(function() {
    $('.tabs > li').click(function(){
        var id = $(this).attr("id");
        $(this).addClass("current");
        $(id).show();
        $(this).siblings().each(function(){
            var id = $(this).attr("id");
            $(this).removeClass("current");
            $(id).hide();
        });
    });
    $('.tabs > li:first').click();
HTML:      <ul class="tabs clear">
                <li id="#punish_info">添加父亲信息</li>
                <c:if test="${not empty entShrPunish.uuid}">
                    <li id="#punishalt_info">添加母亲信息</li>
                </c:if>
            </ul>
            <div id="punish_info">



posted @ 2017-07-03 17:21  nobug的世界  阅读(172)  评论(0编辑  收藏  举报