jquery版tab切换

**


直接从项目粘出来的,样式什么的可能有点问题


HTML代码

**

最新 活动

即将上线啦啦啦啦啦啦啦1啦啦啦啦啦啦啦1

2018-11-05

即将上线啦啦啦啦啦啦啦1

2018-12-28

即将上线啦啦啦啦啦啦啦1

2018-11-05

即将上线啦啦啦啦啦啦啦1

2018-11-05

即将上线啦啦啦啦啦啦啦1

2018-11-05

即将上线啦啦啦啦啦啦啦2

2018-11-05

即将上线啦啦啦啦啦啦啦2

2018-11-05

即将上线啦啦啦啦啦啦啦2

2018/11/5

即将上线啦啦啦啦啦啦啦2

2018/11/5

即将上线啦啦啦啦啦啦啦2

2018/11/5

css代码

.swiper_right{
width: 400px;
height: 253px;
margin-top: 30px;
margin-left: 20px;
}

.swiper_right .right_nav{
width: 100%;
}
.swiper_right .right_nav span{
display: inline-block;
width: 50px;
text-align: center;
font-size: 16px;
position: relative;
padding: 0 6px;
}

.swiper_right .right_nav span:hover{
color: #b49857;
cursor: pointer;
}

.swiper_right .right_nav span.active{
color: #b49857;
}
.swiper_right div.news-container{
margin-top: 20px;
}
.swiper_right div.news-container .news-items .news-item{
display: flex;
height: 38px;
border-bottom: dashed 1px #a0a0a0;
line-height: 38px;
}
.swiper_right div.news-container .news-items .news-item:hover p:nth-child(1){
color: #b49857;
}

.swiper_right div.news-container .news-items .news-item div.news-title{
flex: 1;
overflow: hidden;
}
.swiper_right div.news-container .news-items .news-item div.news-title>a{
display: flex;
justify-content: space-between;
box-sizing: border-box;
flex: 1;
text-align: left;
}
.swiper_right div.news-container .news-items .news-item div.news-title>a>p{
font-size: 14px;
color: #626262;
max-width: 20em;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
display: block;
}

**

js代码

$(’ .swiper_right .right_nav span’).click(function(){
$(this).addClass(‘active’).siblings().removeClass(‘active’)
let index = $(this).index();
$(’ .swiper_right .news-items’).eq(index).show().siblings().hide();
});
**

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值