tab栏圆点按钮_带左右点击按钮的tab选项卡

html5

.box {margin: 30px auto; width: 500px; height: 300px;}

.left ,.right {width: 100px; background: #eaeaea;display: inline-block; margin: 0 10px; text-indent: 20px; margin-bottom: 20px;}

.tab_t { border: #ccc solid 1px; font-weight: normal;}

.tab_t a { width:65px; text-align: center; display: inline-block;}

a.tab_t_hover {color: red; background: #eaeaea; font-weight: bold;}

.tab_b {border: #ccc solid 1px; border-top: none; padding: 15px;}

function tab_menu(cssname1,hovercss,cssname2){

$(cssname2 + ":not(:first)").hide();

$(".left").click(function(){

j = $("." + hovercss).index();

if(j>0){

v = j - 1;

}else{

v = 0;

}

$(cssname1).eq(v).addClass(hovercss).siblings().removeClass(hovercss);

$(cssname2).eq(v).fadeIn().siblings(cssname2).hide();

});

$(".right").click(function(){

j = $("." + hovercss).index();

if(j <= $("." + hovercss + ":last").index()){

v = j + 1;

}else{

v = $("." + hovercss + ":last").index();

}

$(cssname1).eq(v).addClass(hovercss).siblings().removeClass(hovercss);

$(cssname2).eq(v).fadeIn().siblings(cssname2).hide();

});

$(cssname1).mouseover(function(){

var i = $(this).index();

$(this).addClass(hovercss).siblings().removeClass(hovercss);

if($(cssname2).eq(i).is(":animated")){

$(cssname2).eq(i).stop(false,true).fadeIn().siblings(cssname2).hide();

}else{

$(cssname2).eq(i).fadeIn().siblings(cssname2).hide();

}

});

}

$(function(){

new tab_menu(".tab_t a","tab_t_hover",".tab_b_list");

})

leftright

11|22|33|44|55|66|77

1111111

22223

33333

44444

555555

66666

777777

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值