本文实例为大家分享了js实现tab栏切换效果的具体代码,供大家参考,具体内容如下
效果展示:
源码展示:
js实现tab栏切换 * { margin: 0; margin: 0; padding: 0; list-style: none; } .nav { width: 100%; height: 50px; } .nav ul { width: 600px; height: 50px; margin: 0 auto; } .nav ul li { width: 120px; height: 50px; font-weight: 800; font-size: 18px; color: #515151; line-height: 50px; text-align: center; float: left; cursor: pointer; } .tiao { width: 600px; height: 5px; background-color: #515151; margin: 0 auto; position: relative; top: 0; left: 0; } .zhou { width: 120px; height: 5px; background-color: red; position: absolute; top: 0; left: 0; } .ww { width: 0px; border-width: 8px; border-style: solid; border-color: rgba(250, 0, 255, 0) rgba(250, 0, 255, 0) red rgba(250, 0, 255, 0); position: absolute; top: -16px; left: 56px; } .nei { width: 600px; height: 300px; margin: 0 auto; } .nei li { width: 600px; height: 300px; color: #fff; font-family: "微软雅黑"; font-size: 40px; text-align: center; line-height: 300px; display: none; margin-top: 10px; }
- 大娃
- 二娃
- 三娃
- 四娃
- 五娃
- 大娃出世
- 二娃出世
- 三娃出世
- 四娃出世
- 五娃出世
感: 最近贡献一下我在教学中的小案例可以能给你一些帮助 ,希望继续关注我的博客 --王
如果大家还想深入学习,可以点击两个精彩的专题:javascript选项卡操作方法汇总 jquery选项卡操作方法汇总
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持考高分网。



