jquery实现常用UI布局
tab

- html
<div class="tab">
<ul class="tab-title">
<li class="tab-this">item1</li>
<li>item2</li>
<li>item3</li>
</ul>
<div class="tab-content">
<div class="tab-item show">item1xxx</div>
<div class="tab-item">item2xxx</div>
<div class="tab-item">item3xxx</div>
</div>
</div>
- css
*{
padding: 0; margin: 0; text-decoration: none; list-style: none;
font-family: Consolas;
}
.tab{
margin: 20px;
}
/*tab-title*/
.tab-title {
height: 40px;
position: relative;
left: 0;
white-space: nowrap;
border-bottom-width: 1px;
border-bottom-style: solid;
border-color: #e2e2e2;
transition: all .2s;
-webkit-transition: all .2s;
}
.tab-title>li{
display: inline-block;
padding: 0 15px;
text-align: center;
cursor: pointer;
line-height: 40px;
min-width: 65px;
position: relative;
}
.tab-title .tab-this:after {
position: absolute;
left: 0;
top: 0;
content: '';
width: 100%;
height: 41px;
border-width: 1px;
border-style: solid;
border-color: #e2e2e2;
border-bottom-color: #fff;
border-radius: 2px 2px 0 0;
box-sizing: border-box;
pointer-events: none;
}
.tab-item{
display: none;
}
.show{
display: block !important;
}
- js
$('body').on('click','.tab-title>li:not(.tab-this)', function(){
$(this).siblings().removeClass('tab-this');
$(this).addClass('tab-this');
var index = $(this).prevAll().length+1;
$('.tab-content>div').removeClass('show');
$('.tab-content>div:nth-child('+index+')').addClass('show');
});
jquery实现常用UI布局的更多相关文章
- 常用UI布局
1.LinearLayout(线性布局):将布局所包含的控件在线性方向上依次排列. <1>android:orientation 指定了排列方向(垂直方向(vertical).水平方向(h ...
- 基于jquery开发的UI框架整理分析
根据调查得知,现在市场中的UI框架差不多40个左右,不知大家都习惯性的用哪个框架,现在市场中有几款UI框架稍微的成熟一些,也是大家比较喜欢的一种UI框架,那应该是jQuery,有部分UI框架都是根据j ...
- 常用前端布局,CSS技巧介绍
常用前端布局,CSS技巧介绍 对前端常用布局的整理总结,并对其性能优劣,兼容等情况进行介绍 css常用技巧之可变大小正方形的绘制 1:若通过设置width为百分比的方式,则高度不能通过百分比来控制. ...
- Android开发 UI布局
Android开发 UI布局一.线性布局LinearLayout 什么是线性布局? 其实呢,线性布局就是把所有的孩子摆在同一条线上 <?xml version="1.0" e ...
- Duilib源码分析(五)UI布局—Layout与各子控件
接下来,继续分析duilib之UI布局Layout,目前提供的布局有:VerticalLayout.HorizontalLayout.TileLayout.TabLayout.ChildLayout分 ...
- iOS-屏幕适配-UI布局
iOS 屏幕适配:autoResizing autoLayout和sizeClass 一.图片解说 -------------------------------------------------- ...
- AppleWatch___学习笔记(二)UI布局和UI控件
1.UI布局 直接开发,你会发现Apple Watch并不支持AutoLayout,WatchKit里有个类叫做WKInterfaceGroup,乍一看像是UIView,但是这货其实是用来布局的.从 ...
- DIV+CSS常用网页布局技巧!
以下是我整理的DIV+CSS常用网页布局技巧,仅供学习与参考! 第一种布局:左边固定宽度,右边自适应宽度 HTML Markup <div id="left">Left ...
- iOS开发~UI布局(三)深入理解autolayout
一.概要 通过对iOS8界面布局的学习和总结,发现autolayout才是主角,autolayout是iOS6引入的新特性,当时还粗浅的学习了下,可是没有真正应用到项目中.随着iOS设备尺寸逐渐碎片化 ...
随机推荐
- ng-repeat 设定select 选择项
<select class="form-control m-b" name="FPermissionID" ng-model="mgfunc.F ...
- Python 基础之函数初识与函数参数
一.函数初识 定义:满足某一个方法 满足某一个功能#(1)功能(包裹一部分代码 实现某一个功能 达成某一个目的)#(2)可以反复调用,提高代码的复用性,提高开发效率,便于维护管理#(3)函数的基本格式 ...
- LibreOJ #6008. 「网络流 24 题」餐巾计划
这道题其实我在刚学 OI 的时候就在一本通上看见过,还记得上面写着"新餐巾一次性买完"之类的话.当时还很稚嫩(现在也是),想了好久,根本想不出来. 学了网络流之后发现这道题的图也是 ...
- python用户界面编程和文件转换为exe文件
python用户界面编程学习代码如下所示: #python用户图形界面编程实现import sys #简单用户图形界面实现from PyQt5.QtWidgets import QApplicatio ...
- [转]网络协议-redis协议
Redis 通信协议(protocol) 本文档翻译自: http://redis.io/topics/protocol . Redis 协议在以下三个目标之间进行折中: 易于实现 可以高效地被计算机 ...
- 吴裕雄 Bootstrap 前端框架开发——Bootstrap 表单:内联表单
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...
- C#委托-事件示例
Program.cs using System;using System.Collections.Generic;using System.Linq;using System.Text;using S ...
- java并发AtomicReference
java并发AtomicReference AtomicReference的作用 已经介绍过AtomicInteger,AtomicIntegerArray,AtomicReference是针对对象的 ...
- SSH、SSL与HTTPS的联系
SSH 维基百科中对SSH协议的定义如下 Secure Shell(缩写为SSH),由IETF的网络工作小组(Network Working Group)所制定:SSH为一项创建在应用层和传输层基础上 ...
- 信号强度(RSSI)知识整理
来源: https://www.cnblogs.com/lele/articles/2832885.html 为什么无线信号(RSSI)是负值 答:其实归根到底为什么接收的无线信号是负值,这样子是不是 ...