常用tab选项卡代码

<div class="box">
    <ul>
        <li class="one">课程介绍</li>
        <li>报名流程</li>
        <li>常见问题</li>
    </ul>
    <div class="content">
        <div class="ct">随着移动互联网的兴起,互联网行业正向更加智能化的Web3.0时代迈进,中国互联网行业进入了高速发展的势态,PHP语言已经为大部分企业广泛应用和重视 </div>
        <div class="ct">在jQuery迅速发展的同时,一些大的厂商也看中了商机。2009年9月,微软和诺基亚公司正式宣布支持开源的jQuery库,另外,微软公司还宣称他们将把jQuery作为Visual Studio工具集的一部分。 </div>
        <div class="ct">2010年1月,也是jQuery的四周年生日,jQuery 1.4版发布,为了庆祝jQuery四周岁生日,jQuery团队特别创建了jquery14.com站点,带来了连续14天的新版本专题介绍。 </div>
    </div>
</div>
 * {
    padding:0;
    margin:0;
}
body {
    font-size:12px;
    padding:100px;
}
ul {
    list-style-type:none;
}
.box ul {
    height:30px;
    line-height:30px;
}
.box ul li {
    float:left;
    padding:0 10px;
    position:relative;
    cursor:pointer;
    border:1px solid #000;
    margin-right:5px;
    border-bottom:none;
}
.box ul li.two {
    background:orange;
}
.content {
    width:325px;
    border:1px solid #000;
    padding:10px;
    height:100px;
}
* html .content {
    margin-top:-1px;
}
.box ul li.one {
    background:#fff;
}
$(document).ready(function() {
    $('.ct:gt(0)').hide();
    var hdw = $('.box ul li');
    hdw.hover(function() {
        $(this).addClass('two').siblings().removeClass('two');
    });
    hdw.click(function() {
        $(this).addClass('one').siblings().removeClass();
        var hdw_index = hdw.index(this);
        $('.ct').eq(hdw.index(this)).show().siblings().hide();
    });
});

 

转载于:https://www.cnblogs.com/phpfensi/p/7298506.html

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值