jQuery css3彩色带图标tab选项卡代码



70 279 94



特效描述:jQuery css3 彩色带图标 tab选项卡代码,jQuery css3彩色带图标tab选项卡代码

代码结构

1. 引入CSS

<link rel="stylesheet" type="text/css" href="css/zzsc-demo.css">
<link rel="stylesheet" href="assets/css/tabs/tabs-basic.css">

2. 引入JS

<script src="http://libs.useso.com/js/jquery/1.11.0/jquery.min.js" type="text/javascript"></script>
<script>window.jQuery || document.write('<script src="js/jquery-1.11.0.min.js"><\/script>')</script>

3. HTML代码

<div class="zzsc-container">
	<header class="zzsc-header">
		<h1>4种超酷Tabs选项卡设计效果 <span>4 Excellent Tabs Design</span></h1>
		<div class="zzsc-demo center">
		  <a href="index.html" class="current">基本</a>
		  <a href="index2.html">彩色</a>
		  <a href="index3.html">下划线</a>
		  <a href="index4.html">垂直</a>
		</div>
	</header>
	<div class="tabs-basic">
		<ul>
			<li>
				<a class="tab-active" data-index="0" href="#">First tab</a>
			</li>
			<li>
				<a data-index="1" href="#">Second tab</a>
			</li>
			<li>
				<a data-index="2" href="#">Third tab</a>
			</li>
		</ul>
		<div class="tabs-content-placeholder">
			<div class="tab-content-active">
				<p>Lorem ipsum dolor ist amet, consectetur adipiscing elit. Suspendisse molestie volutpat consectetur. Class aptent taciti sociosqu ad litora torquent per conubia nostra.</p>
				<img src="assets/images/pictures/bahnhoff.jpg" alt="Banhoff">
			</div>
			<div>
				<p>Lorem ipsum dolor ist amet, consectetur adipiscing elit. Suspendisse molestie volutpat consectetur. Class aptent taciti sociosqu ad litora torquent per conubia nostra.</p>
				<img src="assets/images/pictures/colosseum.jpg" alt="Colosseum">
			</div>
			<div>
				<p>Lorem ipsum dolor ist amet, consectetur adipiscing elit. Suspendisse molestie volutpat consectetur. Class aptent taciti sociosqu ad litora torquent per conubia nostra.</p>
				<img src="assets/images/pictures/sands-of-life.jpg" alt="Sands of Life">
			</div>
		</div>
	</div>
</div>
<script>
	$(document).ready(function() {
		var widget = $('.tabs-basic');
		var tabs = widget.find('ul a'),
			content = widget.find('.tabs-content-placeholder > div');
		tabs.on('click', function (e) {
			e.preventDefault();
			// Get the data-index attribute, and show the matching content div
			var index = $(this).data('index');
			tabs.removeClass('tab-active');
			content.removeClass('tab-content-active');
			$(this).addClass('tab-active');
			content.eq(index).addClass('tab-content-active');
		});
	});
</script>



用户评论
大牛,别默默的看了,快登录帮我点评一下吧!:)      登录 | 注册


热门标签: 滚动切换 滚动条切换 滑动选项卡 滑动切换 选项卡切换 选项卡 切换 tab切换 页面切换 选项卡插件 切换插件 滑动手风琴 选项卡自动切换

×
×

注册

官方QQ群

扫描上面二维码加微信群

官方QQ群

jQuery/js讨论群
群号:642649996
Css3+Html5讨论群
群号:322131262

加群请备注:从官网了解到