<html>
<head>
<!-- Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="/stylesheets/bootstrap.min.css">

<!-- jQuery文件 -->
<script src="/scripts/jquery.min.js"></script>

<!-- Bootstrap 核心 JavaScript 文件 -->
<script src="/scripts/bootstrap.min.js"></script>
<style type="text/css">
.tab .nav-tabs {
border-bottom: 0 none;
background: #eaeaea;
}
.tab .nav-tabs li a {
background: transparent;
border-radius: 0;
font-size: 16px;
border: none;
color: #333;
padding: 12px 22px;
}
.tab .nav-tabs li.active a, .tab .nav-tabs li.active a i {
border: 0 none;
background:#e67e22;
color: #fff;
}
.tab .nav-tabs li.active a:after {
content: "";
position: absolute;
left: 45%;
bottom: -14px;
border: 7px solid transparent;
border-top: 7px solid #e67e22;
}
.tab .tab-content {
padding: 5px;
color: #5a5c5d;
font-size: 14px;
line-height: 20px;
margin-top: 5px;
border-bottom: 1px solid #e67e22;
}
@media only screen and (max-width: 480px) {
.tab .nav-tabs, .tab .nav-tabs li {
width: 100%;
background: transparent;
}
.tab .nav-tabs li.active a {
border-radius: 10px 10px 0 0;
}
.tab .nav-tabs li:first-child a {
border-bottom-left-radius: 0;
}
.tab .nav-tabs li a {
margin-bottom: 10px;
border: 1px solid lightgray;
}
.tab .nav-tabs li.active a:after {
border: none;
}
}
</style>
</head>
<body>
<div class="container">
<div class="tab" role="tabpanel">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist" style="margin-top:0px;" id="docTabs">
<li role="presentation" class="active"><a href="#Section_new"
aria-controls="home" role="tab" data-toggle="tab"> 最新</a>
<li role="presentation"><a href="#Section_week"
aria-controls="profile" role="tab" data-toggle="tab">7天热门</a>
<li role="presentation"><a href="#Section_month"
aria-controls="messages" role="tab" data-toggle="tab">30天热门</a>
</ul>
<!-- Tab panes -->

<div class="tab-content">
<div role="tabpanel" class="tab-pane fade in active" id="Section_new">
<P>
tab1中的内容
</P>
</div>
<div role="tabpanel" class="tab-pane fade" id="Section_week">
<P>
tab2中的内容
</P>
</div>
<div role="tabpanel" class="tab-pane fade" id="Section_month">
<P>
tab3中的内容
</P>
</div>
</div>
</div>
</div>
<script type="text/javascript">
function timer(i)
{
interval=setInterval(function()
{
$("#docTabs li:eq("+i+") a").tab('show');
i++;
if(i>2)
i=0;
},2000);//为了演示需要,间隔时间改为2秒
return interval;
}
$(function(){
var i=0;
interval=timer(i);
$(".tab-pane").mouseover(function(){
clearInterval(interval);
});
$(".tab-pane").mouseout(function(){
timer(i);
});
});
</script>
</body>
</html>

tabs自动切换功能的实现

文章列表中列出的最新、7天热门、30天热门这三个选项卡每隔5秒钟自动切换,当鼠标悬停到某选项卡的时候,则暂停轮换,移开后,继续切换。代码设计思路如下:

  1. 设置一个定时器timer(),每隔5秒钟对标签页进行切换一次。
  2. 在网页加载完以后就运行该定时器。
  3. 当用户鼠标悬停到某个标签页上时,清除该(clearInterval)定时器。
  4. 鼠标移开后,继续使用定时器。
  1. //tabs自动轮换
  2. function timer(i)
  3. {
  4. interval=setInterval(function()
  5. {
  6. $("#docTabs li:eq("+i+") a").tab('show');
  7. i++;
  8. if(i>2)
  9. i=0;
  10. }
  11. ,5000);
  12. return interval;
  13. }
  14. $(function(){
  15. var i=0;
  16. interval=timer(i);
  17. //当鼠标悬停在列表区域时暂停轮换
  18. $(".tab-pane").mouseover(function(){
  19. clearInterval(interval);
  20. });
  21. //鼠标移开时继续轮换
  22. $(".tab-pane").mouseout(function(){
  23. timer(i);
  24. });
  25. });

开发Jquery tab升级

<html>
<head>
<!-- Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="/stylesheets/bootstrap.min.css">

<!-- jQuery文件 -->
<script src="/scripts/jquery.min.js"></script>

<!-- Bootstrap 核心 JavaScript 文件 -->
<script src="/scripts/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<div class="row" id="indexbooks">
<h4 class="title" style="padding-bottom:10px;">
图 书
<ul style="float:right;font-size:14px;" id="booksfilter">
<li><a href="javascript:void(0);" class="cur">入门</a><span>|</span></li>
<li><a href="javascript:void(0);">实战</a><span>|</span></li>
<li><a href="javascript:void(0);">进阶</a><span>|</span></li>
</ul>
</h4>
<div class="row">
<div class="booklist">

<div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://www.dqiu.net/uploads/146855238081016.jpg">
</a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
Node入门 </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">2推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.doubanio.com/mpic/s1039608.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
LINUX权威指南(... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">1推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.doubanio.com/mpic/s10170467.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
锋利的jQuery(... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">1推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.doubanio.com/mpic/s26269848.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
Sams Teach... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">1推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="/book/577e05d757b0c" target="_blank">
<img style="height:130px;" src="http://www.dqiu.net/uploads/146787664243893.jpg">
</a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
ThinkPHP5快... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">0推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.douban.com/mpic/s4671751.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
DIV+CSS网站布... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">5推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.doubanio.com/mpic/s7654166.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
PHP完全自学手册(... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">4推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.doubanio.com/mpic/s6080118.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
细说PHP(pdf可... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">5推荐</span></p>
</div>
</div>
</div></div>
<div class="booklist" style="display:none;">

<div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.douban.com/mpic/s27179181.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
Linux Shel... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">1推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.doubanio.com/mpic/s28020259.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
微信公众平台开发基础... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">4推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.doubanio.com/mpic/s28058478.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
Bootstrap实... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">1推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.doubanio.com/mpic/s25137429.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
jQuery UI开... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">2推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.douban.com/mpic/s27347131.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
Bootstrap用... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">2推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.douban.com/mpic/s10111843.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
精通ASP.NET2... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">0推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://www.dqiu.net/uploads/141437969040936.gif">
</a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
Fireworks ... </a></h5>
<p style="text-align:center;">
评论(1)&nbsp;<span class="badge">0推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://www.dqiu.net/uploads/141109524640207.jpg">
</a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
PHP MVC开发实... </a></h5>
<p style="text-align:center;">
评论(7)&nbsp;<span class="badge">6推荐</span></p>
</div>
</div>
</div></div>
<div class="booklist" style="display:none;">

<div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.doubanio.com/mpic/s27508138.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
精通AngularJ... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">0推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.doubanio.com/mpic/s27255846.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
iOS开发指南... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">0推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://www.dqiu.net/uploads/146787693051030.jpg">
</a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
ThinkPHP5.... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">1推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.douban.com/mpic/s4692124.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
MongoDB权威指... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">1推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.douban.com/mpic/s5860151.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
JavaScript... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">0推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.douban.com/mpic/s5952772.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
正则表达式入门经典(... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">1推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.douban.com/mpic/s5893432.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
计算机数学基础... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">3推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.douban.com/mpic/s3350961.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
集体智慧编程... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">1推荐</span></p>
</div>
</div>
</div></div>
</div>
</div>
<script type="text/javascript">
$(function()
{
$('#booksfilter a').each(function(i)
{//对每个tabs中的标签添加点击(click)事件的处理函数

$(this).click(function(){
$(this).addClass('cur');
$(this).parent().siblings().find('a').removeClass('cur');//删除其他任何选项的cur类
$('.booklist').eq(i).show();//显示本节点
$('.booklist').eq(i).siblings().hide();//隐藏兄弟节点
})

});

});
</script>
</body>
</html>

<html>
<head>
<!-- Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="/stylesheets/bootstrap.min.css">

<!-- jQuery文件 -->
<script src="/scripts/jquery.min.js"></script>

<!-- Bootstrap 核心 JavaScript 文件 -->
<script src="/scripts/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<div class="row" id="indexbooks">
<h4 class="title" style="padding-bottom:10px;">
图 书
<ul style="float:right;font-size:14px;" id="booksfilter">
<li><a href="javascript:void(0);" class="cur">入门</a><span>|</span></li>
<li><a href="javascript:void(0);">实战</a><span>|</span></li>
<li><a href="javascript:void(0);">进阶</a><span>|</span></li>
</ul>
</h4>
<div class="row">
<div class="booklist">

<div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://www.dqiu.net/uploads/146855238081016.jpg">
</a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
Node入门 </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">2推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.doubanio.com/mpic/s1039608.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
LINUX权威指南(... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">1推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.doubanio.com/mpic/s10170467.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
锋利的jQuery(... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">1推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.doubanio.com/mpic/s26269848.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
Sams Teach... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">1推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="/book/577e05d757b0c" target="_blank">
<img style="height:130px;" src="http://www.dqiu.net/uploads/146787664243893.jpg">
</a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
ThinkPHP5快... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">0推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.douban.com/mpic/s4671751.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
DIV+CSS网站布... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">5推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.doubanio.com/mpic/s7654166.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
PHP完全自学手册(... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">4推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.doubanio.com/mpic/s6080118.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
细说PHP(pdf可... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">5推荐</span></p>
</div>
</div>
</div></div>
<div class="booklist" style="display:none;">

<div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.douban.com/mpic/s27179181.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
Linux Shel... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">1推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.doubanio.com/mpic/s28020259.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
微信公众平台开发基础... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">4推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.doubanio.com/mpic/s28058478.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
Bootstrap实... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">1推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.doubanio.com/mpic/s25137429.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
jQuery UI开... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">2推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.douban.com/mpic/s27347131.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
Bootstrap用... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">2推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.douban.com/mpic/s10111843.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
精通ASP.NET2... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">0推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://www.dqiu.net/uploads/141437969040936.gif">
</a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
Fireworks ... </a></h5>
<p style="text-align:center;">
评论(1)&nbsp;<span class="badge">0推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://www.dqiu.net/uploads/141109524640207.jpg">
</a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
PHP MVC开发实... </a></h5>
<p style="text-align:center;">
评论(7)&nbsp;<span class="badge">6推荐</span></p>
</div>
</div>
</div></div>
<div class="booklist" style="display:none;">

<div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.doubanio.com/mpic/s27508138.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
精通AngularJ... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">0推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.doubanio.com/mpic/s27255846.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
iOS开发指南... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">0推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://www.dqiu.net/uploads/146787693051030.jpg">
</a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
ThinkPHP5.... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">1推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.douban.com/mpic/s4692124.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
MongoDB权威指... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">1推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.douban.com/mpic/s5860151.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
JavaScript... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">0推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.douban.com/mpic/s5952772.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
正则表达式入门经典(... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">1推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.douban.com/mpic/s5893432.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
计算机数学基础... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">3推荐</span></p>
</div>
</div>
</div><div class="col-xs-3">
<div class="thumbnail" style="height:220px; border-width:0px;">
<a href="javascript:void(0)" target="_blank">
<img style="height:130px;" src="http://img3.douban.com/mpic/s3350961.jpg"> </a>
<div class="caption">
<h5 style="text-align:center;">
<a href="javascript:void(0)" target="_blank">
集体智慧编程... </a></h5>
<p style="text-align:center;">
评论(0)&nbsp;<span class="badge">1推荐</span></p>
</div>
</div>
</div></div>
</div>
</div>
<script type="text/javascript">
$(function()
{
$('#booksfilter a').each(function(i)
{//对每个tabs中的标签添加点击(click)事件的处理函数

$(this).click(function(){
$(this).addClass('cur');
$(this).parent().siblings().find('a').removeClass('cur');//删除其他任何选项的cur类
$('.booklist').eq(i).show();//显示本节点
$('.booklist').eq(i).siblings().hide();//隐藏兄弟节点
})

});

});
</script>
</body>
</html>

tabs自动切换功能的实现的更多相关文章

  1. html+css+jQuery+JavaScript实现tab自动切换功能

    tab1.html内容 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> & ...

  2. CSS实现页面背景自动切换功能

    From here:http://xiaomiya.iteye.com/blog/2047728 请看效果图: 完整代码如下: <!DOCTYPE HTML> <html> & ...

  3. Maven + Spring 进行多环境自动切换功能

    在pom.xml的<project></project>的最下放写入如下代码: <!-- profiles setting start [mvn install -P x ...

  4. Mycat在MySQL主从模式(1主1从)下读写分离和及自动切换模式的验证

    实验环境 两台Centos7  MySQL5.7.12 IP地址为:192.168.10.36  192.168.10.37 一台Centos7 Mycat IP地址为:192.168.10.31 一 ...

  5. javascript实现自动切换焦点功能学习

    当用户在表单中填写完当前字段后,能否自动将焦点跳转到下一个字段以方便用户输入? 为了增强易用性,加快数据输入的速度,可以在前一个文本框中的字符达到一定的设置的字符长度后(比如电话号码,身份证号等),用 ...

  6. bootstrap tab切换如何让鼠标移动自动切换内容

    bootstrap集成了很多功能,比如nav-tabs组件,可以将相似的内容集中在一个区块中展示.bootstrap tab切换默认是要点击才会切换的,如何实现鼠标移动就自动切换呢?如下图所示,光标移 ...

  7. WebStorm 编辑器 关闭自动保存功能及添加*星星标记

    WebStorm 关闭自动保存功能添加*星星标记为什么要关闭自动保存?      ​ 在前端项目工作当中,往往会采用自动化环境(Gulp.webpack等)当文本发生变化的时候就会自动编译代码.在we ...

  8. 获取bing.com的图片并在gnome3中设置自动切换

    发现 bing.com 上的图片很好看,因此打算每天把 bing.com 的图片下载下来,用作桌面. 需要做的是两个部分,爬取图片到目录和设置目录图片为桌面背景并可以自动切换. 第一部分,下载图片,使 ...

  9. 在 Visual Studio 等编辑器/IDE中自动切换输入法,不需要手动的有没有?

    使用Visual Studio写代码,经常遇到的一个问题就是切换中文输入法麻烦,输入完注释//,要切换到中文,输入完引号,要输入中文,然后还需要切换回来,有没有? 有时候中文输入法忽然失效有没有?明明 ...

随机推荐

  1. 8.css内容移出与精灵图

    定位的盒子居中显示 ★:margin:0 auto;  只能让标准流的盒子居中对齐. ★定位的盒子居中:先左右走父元素盒子的一半50%,在向左走子盒子的一半(margin-left:负值.) 标签包含 ...

  2. pycharm的基本使用

    1.设置注释字体的颜色,如下图 2.常用快捷键 Ctrl + Space 基本的代码完成(类.方法.属性) Ctrl + Alt + Space 类名完成 Ctrl + Shift + Enter 语 ...

  3. 【转】PowerDesigner删除外键关系,而不删除外键列

    原文:https://blog.csdn.net/tomsyc/article/details/6075530 PowerDesigner中配置外键关系时,如果要删除配置的外键关系,默认设置会一同删除 ...

  4. 正则表达式中 re.match与re.search的区别

    标签: 本文和大家分享的主要是python正则表达式中re.match函数与re.search方法的相关用法及异同点,希望通过本文的分享,能对大家有所帮助. re.match函数 re.match 尝 ...

  5. 13_python_内置函数

  6. zookeeper的安装与配置(单机和集群)

    单机模式: 1.首先去官网下载zookeeper的包 zookeeper-3.4.10.tar.gz 2.用FTP上传到服务器或者Linux虚拟机的/usr/local目录下 3.解压文件tar -z ...

  7. linux源码安装的步骤

    源码安装的过程中多多少少会遇到问题,在此仅简述一下安装的步骤,具体安装的过程中遇到的问题,具体解决. 安装步骤: 1.获取源码 name.gz 2.解包 tar -xvf name.gz (cd到包解 ...

  8. 多态、抽象类、接口_DAY09

    1:多态(掌握) (1)多态概念:一种事物的多种形态 (2)体现:父类的引用指向其子类的实例对象;接口的引用指向其实现类的实例对象 (3)特点: 成员方法:编译看左边,运行看右边 运行:子类重写的方法 ...

  9. 监督学习——AdaBoost元算法提高分类性能

    基于数据的多重抽样的分类器 可以将不通的分类器组合起来,这种组合结果被称为集成方法(ensemble method)或者元算法(meta-algorithom) bagging : 基于数据随机抽样的 ...

  10. Android之密码的显示与隐藏

    很多应用都是显示与隐藏密码的功能. 之前的项目都没这个功能要求,也没有专门研究这个.最近项目有加这个功能,我这里也刚好整理一下. 我的思路是设置EditText的InputType.代码如下: if ...