纯js实现网页tab选项卡切换效果

 时间:2024-10-13 00:19:56

1、新建html文档。

纯js实现网页tab选项卡切换效果

3、书写css样式。<style>* { margin: 0; padding: 0; }bo颊俄岿髭dy { font-size: 14px; font-family: "Microsoft YaHei"; }ul, li { list-style: none; }#tab { position: relative; }#tab .tabList ul li { float: left; background: #fefefe; background: -moz-linear-gradient(top, #fefefe, #ededed); background: -o-linear-gradient(left top, left bottom, from(#fefefe), to(#ededed)); background: -webkit-gradient(linear, left top, left bottom, from(#fefefe), to(#ededed)); border: 1px solid #ccc; padding: 5px 0; width:200px; text-align: center; margin-left: -1px; position: relative; cursor: pointer; }#tab .tabCon { position: absolute; left: -1px; top: 32px; border: 1px solid #ccc; border-top: none; width: 803px; height: 100px; }#tab .tabCon div { padding: 10px; position: absolute; opacity: 0; filter: alpha(opacity=0); }#tab .tabList li.cur { border-bottom: none; background: #fff; }#tab .tabCon div.cur { opacity: 1; filter: alpha(opacity=100); }</style>

纯js实现网页tab选项卡切换效果

5、查看效果。

纯js实现网页tab选项卡切换效果
  • C#如何通过代码更改背景颜色
  • jQuery查找不等于某个id的元素如何表示?
  • 多组tab菜单栏目切换
  • 在Firefox浏览器如何加插件轻松采集网页内容
  • 在服务器端安装DHCP服务器
  • 热门搜索
    庐山的特点 宝宝头睡偏了怎么办 用360怎么重装系统 顽固性失眠怎么办 浙江旅游景点大全 逆战怎么跳舞 三沙市旅游 怀孕期间可以同房吗 湖北旅游景点 云顶山风景区