(原生HTML+CSS++JS)之标签元素Ul下级的li从第二个开始移除左边框样式,似的所有边框样式趋同,大小统一

布局:

    //左侧菜单
    $('.left-nav #nav').on('click', 'li', function (event) {
        setTimeout(()=>{
            $('.layui-tab-title li').each(function (index,item) {
                //console.log("获取选项卡的个数:");
                //console.log($('.layui-tab-title li').length);
                if($('.layui-tab-title li').length>1){
                //只有一个tab选项卡时,背景为黑色;
                    $('.home').removeClass('home_initStyle');
                 //边框大小,样式统一;
                    $('.layui-tab-title li:nth-child('+(index+2)+') ').css('border-left','none');
                }
            });
        },120)    
       .home_initStyle{
            background-color:rgba(243, 243, 243, 1);
        }

如果以后能用得到呢..

posted @ 2020-07-23 15:32  晨曦_yuan小海  阅读(467)  评论(0)    收藏  举报