栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > Web开发 > JavaScript

JS实现简单tab选项卡切换

JavaScript 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

JS实现简单tab选项卡切换

本文实例为大家分享了JS实现简单tab选项卡切换的具体代码,供大家参考,具体内容如下

本人在上一篇文章也写了用JS来实现tab选项卡切换效果,但是上次的那个代码比较复杂,这次是简化版的。




 
 Tab效果
 
 ul{
 list-style: none;
 }
 *{
 margin: 0;
 padding: 0;
 }
 #tab{
 border: 1px solid #ccc;
 margin: 20px auto;
 width: 403px;
 border-top: none;
 }
 .list ul{
 overflow: hidden;
 }
 .list li{
 float: left;
 }
 .list li{
 padding-left: 28px;
 padding-right: 28px;
 padding-top: 6px;
 padding-bottom: 6px;
 border: 1px solid #ccc;
 background: -moz-linear-gradient(top, #FEFEFE, #EDEDED);
 background:-webkit-gradient(linear,left top,left bottom, from(#fefefe), to(#ededed));
 border-right: none;
 cursor: pointer;
 }
 #listCon{
 height: 100px;
 }
 #listCon div{
 padding:10px;
 position:absolute;
 opacity:0;
 filter:alpha(opacity=0);
 }
 .list li:first-child{
 border-left: none;
 }
 .list li:hover{
 background: #fff;
 border-bottom: none;
 }
 .list li.cur{
 background: #fff;
 border-bottom: none;
 }
 #listCon div.cur{
 opacity:1;
 filter:alpha(opacity=100);
 }
 


 
 
 
  • 许嵩
  • 周杰伦
  • 林俊杰
  • 陈奕迅
断桥残雪、千百度、幻听、想象之中 红尘客栈、牛仔很忙、给我一首歌的时间、听妈妈的话 被风吹过的夏天、江南、一千年以后 十年、K歌之王、浮夸

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持考高分网。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/72937.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号