/*========================= CSS STYLE=========================== */

.tabWrap {
}
.tabWrap ul {
padding:0;
margin:0;
position:relative;
}
.tabWrap li {
padding:0;
margin:0;
list-style:none;
}
.tabWrap .tabTriggerUL {
display:table;
width:100%;
}
.tabWrap .tabTriggerLI {
display:table-cell;
padding:5px 20px 2px 20px;
text-align:center;
vertical-align:middle;
}
.tabWrap .tabTriggerA {
text-decoration:none;
display:block;
}
.tabWrap .tabContentUL {
display:block;
border:solid 1px;
position:relative;
overflow:hidden;
}
.tabWrap .tabContentLI {
-webkit-opacity: 0;
-moz-opacity: 0;
opacity: 0;
padding:20px;
position:absolute;
visibility:hidden;
z-index:1;
top:0;
left:0;
-webkit-transition:all .3s ease-out;
-moz-transition:all .3s ease-out;
-ms-transition:all .3s ease-out;
-o-transition:all .3s ease-out;
transition:all .3s ease-out;
}
.tabWrap .showTab {
-webkit-opacity: 1;
-moz-opacity: 1;
opacity: 1;
visibility: visible;
z-index: 2;
}
.tabTreatment1 {
width:625px;
}
.tabTreatment1 .tabTriggerLI {
-webkit-border-top-right-radius: 5px;
-webkit-border-bottom-right-radius: 0;
-webkit-border-bottom-left-radius: 0;
-webkit-border-top-left-radius: 5px;
-moz-border-top-right-radius: 5px;
-moz-border-bottom-right-radius: 0;
-moz-border-bottom-left-radius: 0;
-moz-border-top-left-radius: 5px;
border-top-right-radius: 5px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
border-top-left-radius: 5px;
-moz-background-clip:padding;
-webkit-background-clip:padding-box;
background-clip:padding-box;
background:blue;
border:solid 1px #444;
background:#fffbfb;
background:blue;
background:-moz-linear-gradient(top,#fffbfb 0%,#fff9f9 6%,#ffebeb 25%,#fee8e8 25%,#fee4e4 32%,#fee1e1 33%,
#fed5d5 50%,#fdc6c7 51%,#fcbebf 66%,#fdaaab 92%,#fda7a8 100%);
background:-webkit-linear-gradient(top,#fffbfb 0%,#fff9f9 6%,#ffebeb 25%,#fee8e8 25%,#fee4e4 32%,#fee1e1 33%,
#fed5d5 50%,#fdc6c7 51%,#fcbebf 66%,#fdaaab 92%,#fda7a8 100%);
background:-ms-linear-gradient(top,#fffbfb 0%,#fff9f9 6%,#ffebeb 25%,#fee8e8 25%,#fee4e4 32%,#fee1e1 33%,
#fed5d5 50%,#fdc6c7 51%,#fcbebf 66%,#fdaaab 92%,#fda7a8 100%);
background:-o-linear-gradient(top,#fffbfb 0%,#fff9f9 6%,#ffebeb 25%,#fee8e8 25%,#fee4e4 32%,#fee1e1 33%,
#fed5d5 50%,#fdc6c7 51%,#fcbebf 66%,#fdaaab 92%,#fda7a8 100%);
background:linear-gradient(top,#fffbfb 0%,#fff9f9 6%,#ffebeb 25%,#fee8e8 25%,#fee4e4 32%,#fee1e1 33%,
#fed5d5 50%,#fdc6c7 51%,#fcbebf 66%,#fdaaab 92%,#fda7a8 100%);
filter:progid:dximagetransform.microsoft.gradient(startColorstr='#fffbfb',endColorstr='#fda7a8',GradientType=0);
}
.tabTreatment1 .activeTab {
border-bottom:none;
background:#fffbfb;
background:-moz-linear-gradient(top,#fffbfb 0%,#fff9f9 6%,#ffebeb 25%,#fee8e8 25%,#fee4e4 32%,#fee1e1 33%,
#fed5d5 50%,#fcd4d4 51%,#fcfcfc 100%);
background:-webkit-linear-gradient(top,#fffbfb 0%,#fff9f9 6%,#ffebeb 25%,#fee8e8 25%,#fee4e4 32%,#fee1e1 33%,
#fed5d5 50%,#fcd4d4 51%,#fcfcfc 100%);
background:-ms-linear-gradient(top,#fffbfb 0%,#fff9f9 6%,#ffebeb 25%,#fee8e8 25%,#fee4e4 32%,#fee1e1 33%,
#fed5d5 50%,#fcd4d4 51%,#fcfcfc 100%);
background:-o-linear-gradient(top,#fffbfb 0%,#fff9f9 6%,#ffebeb 25%,#fee8e8 25%,#fee4e4 32%,#fee1e1 33%,
#fed5d5 50%,#fcd4d4 51%,#fcfcfc 100%);
background:linear-gradient(top,#fffbfb 0%,#fff9f9 6%,#ffebeb 25%,#fee8e8 25%,#fee4e4 32%,#fee1e1 33%,
#fed5d5 50%,#fcd4d4 51%,#fcfcfc 100%);
filter:progid:dximagetransform.microsoft.gradient(startColorstr='#fffbfb',endColorstr='#fcfcfc',GradientType=0);
}
.tabTreatment1 .tabTriggerA {
color:#222;
}
.tabTreatment1 .tabContentUL {
border: solid 1px #444;
border-top: none;
-webkit-border-top-right-radius: 0;
-webkit-border-bottom-right-radius: 3px;
-webkit-border-bottom-left-radius: 3px;
-webkit-border-top-left-radius: 0;
-moz-border-top-right-radius: 0;
-moz-border-bottom-right-radius: 3px;
-moz-border-bottom-left-radius: 3px;
-moz-border-top-left-radius: 0;
border-top-right-radius: 0;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
border-top-left-radius: 0;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
-webkit-box-shadow: 0 3px 3px 0 rgba(0,0,0,.4);
-moz-box-shadow: 0 3px 3px 0 rgba(0,0,0,.4);
box-shadow: 0 3px 3px 0 rgba(0,0,0,.4);
-webkit-transition: all .3s ease-out;
-moz-transition: all .3s ease-out;
-o-transition: all .3s ease-out;
-ms-transition: all .3s ease-out;
transition: all .3s ease-out;
}
/*垂直效果*/
.tabTreatment2 {
width: 605px;
overflow: hidden;
padding: 10px;
background: #45484d;
background: -moz-linear-gradient(top,#45484d 0%,#000 100%);
background: -webkit-linear-gradient(top,#45484d 0%,#000 100%);
background: -ms-linear-gradient(top,#45484d 0%,#000 100%);
background: -o-linear-gradient(top,#45484d 0%,#000 100%);
background: linear-gradient(top,#45484d 0%,#000 100%);
filter: progid:dximagetransform.microsoft.gradient(startColorstr='#45484d',endColorstr='#000',GradientType=0);
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
}
.tabTreatment2 .tabTriggerUL {
display: block;
width: 150px;
float: left;
height: 100%;
margin-right: 10px;
}
.tabTreatment2 .tabTriggerLI {
padding: 10px;
text-align: center;
position: relative;
display: block;
margin: 4px 0;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
-webkit-box-shadow: 0 0 3px rgba(255,255,255,.7);
-moz-box-shadow: 0 0 3px rgba(255,255,255,.7);
box-shadow: 0 0 3px rgba(255,255,255,.7);
background: -moz-linear-gradient(top,#7d7e7d 0%,#0e0e0e 100%);
background: -webkit-linear-gradient(top,#7d7e7d 0%,#0e0e0e 100%);
background: -ms-linear-gradient(top,#7d7e7d 0%,#0e0e0e 100%);
background: -o-linear-gradient(top,#7d7e7d 0%,#0e0e0e 100%);
background: linear-gradient(top,#7d7e7d 0%,#0e0e0e 100%);
filter: progid:dximagetransform.microsoft.gradient(startColorstr='#7d7e7d',endColorstr='#0e0e0e',GradientType=0);
}
.tabTreatment2 .tabTriggerA {
text-decoration:none;
display:block;
color:#fff;
position:relative;
top:50%;
}
.tabTreatment2 .tabContentUL {
display: block;
border: solid 1px #999;
position: relative;
overflow: hidden;
-webkit-transition: all .3s ease-out;
-moz-transition: all .3s ease-out;
-o-transition: all .3s ease-out;
-ms-transition: all .3s ease-out;
transition: all .3s ease-out;
}
.tabTreatment2 .tabContentLI {
-webkit-opacity: 0;
-moz-opacity: 0;
opacity: 0;
-webkit-box-shadow: inset 2px 2px 3px rgba(0,0,0,.6);
-moz-box-shadow: inset 2px 2px 3px rgba(0,0,0,.6);
box-shadow: inset 2px 2px 3px rgba(0,0,0,.6);
position:absolute;
visibility:hidden;
top:0;
left:0;
-webkit-transition: all .3s ease-out;
-moz-transition: all .3s ease-out;
-o-transition: all .3s ease-out;
-ms-transition: all .3s ease-out;
transition: all .3s ease-out;
z-index:1;
background:#fff;
background: -moz-linear-gradient(top,#fff 0%,#f6f6f5 47%, #ededed 100%);
background: -webkit-linear-gradient(top,#fff 0%,#f6f6f5 47%, #ededed 100%);
background: -ms-linear-gradient(top,#fff 0%,#f6f6f5 47%, #ededed 100%);
background: -o-linear-gradient(top,#fff 0%,#f6f6f5 47%, #ededed 100%);
background: linear-gradient(top,#fff 0%,#f6f6f5 47%, #ededed 100%);
filter: progid:dximagetransform.microsoft.gradient(startColorstr='#fff',endColorstr='#ededed',GradientType=0);
}
.tabTreatment2 .showTab {
-webkit-opacity: 1;
-moz-opacity: 1;
opacity: 1;
z-index:2;
visibility:visible;
}
.tabTreatment2 .activeTab {
background:#444;
background: -moz-linear-gradient(top,#444 0%, #9e9e9e 100%);
background: -webkit-linear-gradient(top,#444 0%, #9e9e9e 100%);
background: -ms-linear-gradient(top,#444 0%, #9e9e9e 100%);
background: -o-linear-gradient(top,#444 0%, #9e9e9e 100%);
background: linear-gradient(top,#444 0%, #9e9e9e 100%);
filter: progid:dximagetransform.microsoft.gradient(startColorstr='#444',endColorstr='#9e9e9e',GradientType=0);
}

/*=========================== HTML CODE=================================== */

<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie6"><![endif]-->
<!--[if IE 7 ]><html class="ie7"><![endif]-->
<!--[if IE 8 ]><html class="ie8"><![endif]-->
<!--[if IE 9 ]><html class="ie9"><![endif]-->
<!--[if (gt IE 9)| !(IE) ]><!-->
<html class="no-js">
<!--<![endif]-->
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title></title>
<meta name="description" content="" />
<!--移动 viewport 优化:h5bp.com/viewport -->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!--放置 favicon.ico和apple-touch-icon.png到根目录directory:mathiasbynens.be/notes/touch-icons -->
<link rel="stylesheet" href="css/1140.min.css" />
<link rel="stylesheet" href="css/style.css" />
<!--更多关于<head>的信息:h5bp.com/d/head-Tips -->
<!--除了Modernizr build,其他的JS都被放在末尾。Modernizr 支持HTML5元素,并且对高级别浏览器使用性能更加好的特性
创建你自己的Modernizr build:www.modernizr.com/download/ -->
<script type="text/javascript" src="js/modernizr-3.3.1.min.js"></script>
<!--[if gte IE9]><style type="text/css">.gradient{filter:none}</style><![endif]-->
</head>
<body>
<section data-item="tab" class="tabWrap tabTreatment2" id="tabID">
<ul class="tabTriggerUL">
<li class="tabTriggerLI activeTab">
<a href="#tab1" class="tabTriggerA">This is a Tab</a>
</li>
<li class="tabTriggerLI">
<a href="#tab2" class="tabTriggerA">The Triger for a <br/> Long Tab Two</a>
</li>
<li class="tabTriggerLI">
<a href="#tab3" class="tabTriggerA">Don't Forget Me</a>
</li>
<li class="tabTriggerLI">
<a href="#tab4" class="tabTriggerA">I Like Being a Tab</a>
</li>
</ul>
<ul class="tabContentUL" style="height:215px;">
<li class="tabContentLI showTab" data-tabid="#tab1">
<p>
Skateboard banh mi direct trade fanny pack mixtape,pork belly art party.
Dreamcatcher wes anderson raw denim kogi gastropub.
</p>
<p>
Thundercats ennui carles iphone,pour-over photo booth quinoa leggings stumptown PBR fanny pack cliche gluten-free.
</p>
<p>
Small batch tofu gluten-free,vinyl you probably haven't heard of them typewriter umami viral DIY four loko aesthetic.
</p>
</li>
<li class="tabContentLI" data-tabid="#tab2">
<p>
Carles viral yr,williamsburg letterpress ethnic gluten-free aesthetic american apparel ennui
chambray polaroid you probably haven't heard of them.
</p>
<p>
Scenester hoodie tattooed food truck tofu,selvage blog sriracha polaroid hella keytar before
they sold out +1.
</p>
</li>
<li class="tabContentLI" data-tabid="#tab3">
<p>
Hella 8-bit viral master cleanse salvia shoreditch. Leggings banksy mustache,godard VHS truffaut mixtape ethnic umami
gluten-free occupy chips skatboard mcsweeney's small batch.
</p>
<p>
Swag carles terry richardson,chillwave sustainable pickled high life keffiyeh single-origin coffee fanny pack kogi.
</p>
<p>
Carles farm-to-table stumptown,pitchfork williamsburg wes anderson whatever sartorial.You probably haven't heard of them kogi kale chips,
gluten-free scenester
leggings pitchfork authentic next level raw denim mcsweeney's dreamcatcher umami.
</p>
</li>
<li class="tabContentLI" data-tabid="#tab4">
<p>
Swag carles terry richardson,chillwave sustainable pickled high life keffiyeh
single-origin coffee fanny pack kogi.
</p>
<p>
Carles farm-to-table stumptown,pitchfork williamsburg wes anderson whatever
sartorial. You probably haven't heard of them kogi kale chips,gluten-free scenester
leggings pitchfork authentic next level raw denim mcsweeney's dreamcatchar umami.
</p>
</li>
</ul>
</section>

<!--将js放在页面底部,是为了更快加载出页面主体-->
<!--从Google CDN上获取jQuery,如果没有获取到,用本地的文件代替-->
<script type="text/javascript" src="js/lib/jquery.min.js"></script>

<!--脚本被合并和压缩-->
<script type="text/javascript" src="js/plugins-tab.js"></script>
<script type="text/javascript" src="js/script.js"></script>
<!--脚本加载结束-->
<!--加Google统计脚本,将UA-XXXX-X 换成你网站的实际ID。
mathiasbynens.be/notes/async-analytics-snippet -->
<script type="text/javascript">
$('#tabID').tab();
</script>
</body>
</html>

/*=================================Javascript CODE=======================================*/

(function ($) {
$.fn.extend({
// our plugin name
tab: function () {
return this.each(function () {
// define var
var tab = $(this), hash = window.location.has,
// search .tabContentUL.
tabContentUL = tab.find('.tabContentUL'),
tabContentLIs=tabContentUL.find('.tabContentLI'),
// search all .tabTriggerA;
tabTriggers = tab.find('.tabTriggerA'), tabTriggerLIs = tab.find('.tabTriggerLI');
// if URL contains mot
if (hash) {
var count = 0;
tabTriggers.each(function checkHash() {
var t = $(this);
if (t.attr('href') === hash) {
t.parents('.tabTriggerLI').addClass('activeTab');
var currentTab = findTabContentLI(hash);
currentTab.addClass('showTab');
tabContentUL.height(currentTab.outerHeight(true));
} else {
count++;
}
});
//
if (count === tabTriggers.length) {
showFirstTab();
}
} else {
showFirstTab();
}
//binding tabTrigger click
$(this).find('.tabTriggerA').click(function tabTrigger() {
//get clicked .tabTriggerA
var t = $(this);
tabId = t.attr('href'),
targetContentTab = findTabContentLI(tabId);
// remove class:showTab
tabContentLIs.removeClass('showTab');
// remove all class:activeTab
tabTriggerLIs.removeClass('activeTab');
//Add class:activeTab to clicked .tabTriggerA's parent element .tabTriggerLI
//
t.parents('.tabTriggerLI').addClass('activeTab');
//
if (Modernizr.cssanimations) {
tabContentUL.height(targetContentTab.outerHeight(true));
targetContentTab.addClass('showTab');
} else {
tabContentUL.animate({
'height': targetContentTab.outerHeight() + 'px'
}, 300, function showTab() {
targetContentTab.addClass('showTab');
});
}
});
//
if ($('html').hasClass('ie')) {
equalizeTriggerHeights();
}
// find the heightest triggerLI
function equalizeTriggerHeights() {
var maxHeight = 0;
tabTriggerLIs.each(function () {
var t = $(this);
var tHeight = t.height();
if (tHeight > maxHeight) {
maxHeight = tHeight;
}
//
if (!$('html').hasClass('ie7')) {
var tabTrigger = t.find('.tabTriggerA');
tabTrigger.css('margin-top', -(tabTrigger.outerHeight() / 2));
} else {
t.find('.tabTriggerA').css('position', 'static');
setTimeout(function () { ie7Fix(); }, 100);
}
});
tabTriggerLIs.height(maxHeight);
}
function ie7Fix() {
var showTab = tab.find('.showTab');
showTab.css('display', 'block');
tab.find('.tabContentUL').height(showTab.outerHeight(true));
}
//
function findTabContentLI(selector) {
selectedTabContent = tabContentUL.find('.tabContentLI[data-tabid="' + selector + '"]');
return selectedTabContent;
}
// show first tab
function showFirstTab() {
var currentTab = tabContentLIs.eq(0);
currentTab.addClass('showTab');
tabContentUL.height(currentTab.outerHeight(true));
tabTriggers.eq(0).parents('.tabTriggerLI').addClass('activeTab');
}
});
}
});

})(jQuery);

Html5导航插件,支持水平/垂直展示的更多相关文章

  1. SYRefresh 一款简洁易用的刷新控件 支持tableview,collectionview水平垂直刷新功能

    SYRefresh 地址: https://github.com/shushaoyong/SYRefresh 一款简洁易用的刷新控件 示例程序:   默认刷新控件使用方法: //添加头部刷新控件 Sc ...

  2. 一些必看的jQuery导航插件和教程

    导航是一个网站最重要的元素之一,您必须遵循统一的风格来设计您的网站,特别是导航的风格,让用户可以轻松地找到他们想要的内容.这里最大的部分是开发一个菜单,即要直观易用,又要符合你网站的设计风格.本文列举 ...

  3. 10款最新CSS3/jQuery菜单导航插件

    这是我们在2014年收集的10款最新的CSS3 / jQuery菜单导航插件,不论从外观样式,还是功能扩展性,这些jQuery菜单一定可以满足大家的设计需求.这次我们收集的jQuery菜单,有水平 菜 ...

  4. 网站开发中很实用的 HTML5 & jQuery 插件

    这篇文章挑选了15款在网站开发中很实用的 HTML5 & jQuery 插件,如果你正在寻找能优化网站,使其更具创造力和视觉冲击,那么本文正是你需要的.这些优秀的 jQuery 插件能为你的网 ...

  5. 7款个性化jQuery/HTML5地图插件

    现在我们经常会用到一些地图应用,无论是在网页上还是手机App中,地图貌似是一个不可或缺的应用.本文将带领大家一起来看看一些基于jQuery和HTML5的个性化地图插件,有几款地图比较实用,有些则是具有 ...

  6. 站点建设10个最好的响应的HTML5滑块插件

    大多数的最佳响应的HTML5滑块插件能够使用移动应用程序,站点建设项目,以及Web开发项目提供一些令人兴奋的功能,如无限的动画效果,百分之中的一个百响应布局设计和很多其它. 1.别急!慢慢来 功能丰富 ...

  7. html5视频播放插件

    对于HTML5提供的新特性,给前端开发者带来了巨大的激情与动力,减轻了开发者的代码累赘,大大提高了网站性能以及网页的渲染效果.对于低版本的浏览器,由于生产厂商的原因,许多PC端低版本的浏览器还不兼容H ...

  8. CSS实现水平垂直同时居中的5种思路

    × 目录 [1]水平对齐+行高 [2]水平+垂直对齐 [3]margin+垂直对齐[4]absolute[5]flex 前面的话 水平居中和垂直居中已经单独介绍过,本文将介绍水平垂直同时居中的5种思路 ...

  9. Fixed Responsive Nav – 响应式的单页网站导航插件

    Fixed Responsive Nav 是一个响应式的,固定的,触摸友好的单页网站导航插件,响应式导航,流畅的动画滚动.该项目采用渐进增强构建,支持工作在 IE6 及以上版本的浏览器. 你可以给导航 ...

随机推荐

  1. 自定义readonly属性的用法

    具有readonly特性的属性,相当于仅对外提供一个读取接口,在实现文件中是不会自动生成对应的成员变量的,因此使用方法为: // MyItem.h @interface MyItem : NSObje ...

  2. angularJS中directive与controller之间的通信

    当我们在angularJS中自定义了directive之后需要和controller进行通讯的时候,是怎么样进行通讯呢? 这里介绍3种angular自定义directive与controller通信的 ...

  3. 关于访问链接返回XML的获取数据

    1. 返回DataSet格式; /// <summary> /// 向某个url提交数据并读取该地址返回的xml,并将xml转换成dataset,并返回dataset中某个表 /// &l ...

  4. wsdl学习

    本文来自 :迹忆 原文地址:http://www.onmpw.com/tm/xwzj/network_47.html 在刚开始学习Webservice的时候,发现里面涉及到的知识点还真不少,每一点单拿 ...

  5. CSS2样式中选择器的介绍

    这里主要是对css2中的选择器进行了一下总结!

  6. Xamarin.Forms listview中的button按钮,实现带着参数返回上一级页面

    今天在做列表显示的时候遇到一个问题,就是在ListView中如何才能让一个button的按钮工作并且包含参数呢? 其实有点类似于rep里的控件无法起获取一样.在Xamarin中,当你button绑定事 ...

  7. R语言解读多元线性回归模型

    转载:http://blog.fens.me/r-multi-linear-regression/ 前言 本文接上一篇R语言解读一元线性回归模型.在许多生活和工作的实际问题中,影响因变量的因素可能不止 ...

  8. iOS 使用Block进行逆传值

    跟通知一样也是两个控制器,然后代码创建控件直接上代码 #import "ViewController.h" #import "TwoViewController.h&qu ...

  9. SQL-Server使用点滴(二)

    二,对象的建立和使用 1,了解MSSql的[系统表] 对于SQL-Server中的所有对象,包括数据库,数据表,记录,字段,触发器,索引,数据类型等元素,均有对应的系统表记性记录.系统表是禁止直接删改 ...

  10. spring监听器

    1,web.xml中配,因为tomcat启动web项目时先加载web.xml. 2,spring需要启动IOC容器才能为其他框架提供服务,spring是通过监听器来启动容器,初始化 这边启动它,也得告 ...