`

jquery

 
阅读更多
$(document).ready(function(){
  $("button").click(function(){
    $("li").each(function(){
      alert($(this).text())
    });
  });
});



http://www.freejs.net/article_tabbiaoqian_29.html
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
.container {width: 500px; margin: 10px auto;}
ul.tabs {
	margin: 0;
	padding: 0;
	float: left;
	list-style: none;
	height: 32px;
	border-bottom: 1px solid #999;
	border-left: 1px solid #999;
	width: 100%;
}
ul.tabs li {
	float: left;
	margin: 0;
	padding: 0;
	height: 31px;
	line-height: 31px;
	border: 1px solid #999;
	border-left: none;
	margin-bottom: -1px;
	background: #e0e0e0;
	overflow: hidden;
	position: relative;
}
ul.tabs li a {
	text-decoration: none;
	color: #000;
	display: block;
	font-size: 1.2em;
	padding: 0 20px;
	border: 1px solid #fff;
	outline: none;
}
ul.tabs li a:hover {
	background: #ccc;
}	
html ul.tabs li.active, html ul.tabs li.active a:hover  {
	background: #fff;
	border-bottom: 1px solid #fff;
}
.tab_container {
	border: 1px solid #999;
	border-top: none;
	clear: both;
	float: left; 
	width: 100%;
	background: #fff;
	-moz-border-radius-bottomright: 5px;
	-khtml-border-radius-bottomright: 5px;
	-webkit-border-bottom-right-radius: 5px;
	-moz-border-radius-bottomleft: 5px;
	-khtml-border-radius-bottomleft: 5px;
	-webkit-border-bottom-left-radius: 5px;
}
.tab_content {
	padding: 20px;
	font-size: 1.2em;
}


</style>
<script src="/jquery/jquery-1.11.1.min.js">
</script>
<script>
$(document).ready(function() {  
 
    //Default Action  
    $(".tab_content").hide(); //Hide all content  
    $("ul.tabs li:first").addClass("active").show(); //Activate first tab  
    $(".tab_content:first").show(); //Show first tab content  
      
    //On Click Event  
    $("ul.tabs li").click(function() {  
        $("ul.tabs li").removeClass("active"); //Remove any "active" class  
        $(this).addClass("active"); //Add "active" class to selected tab  
        $(".tab_content").hide(); //Hide all tab content  
        var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content  
        $(activeTab).fadeIn(); //Fade in the active content  
        return false;  
    });  
  
});  

</script>
</head>
<body>
<div class="container">  
      
    <ul class="tabs">  
        <li class="active"><a href="#tab1">导航菜单</a></li>  
        <li><a href="#tab4">TAB标签</a></li>  
    </ul>  
    <div class="tab_container">  
        <div id="tab1" class="tab_content" style="display: block; ">  
             11111
        </div>  
          
        <div id="tab4" class="tab_content" style="display: none; ">  
             22222
        </div>  
    </div>  
  
</div>  

</body>
</html>

分享到:
评论

相关推荐

    jquery-3.6.0

    jquery-3.6.0

    Java Web Jquery表单验证

    编写基于Jquery的表单验证插件 Java Web Jquery表单验证 jQuery是一个流行的JavaScript库,可用于在网页上进行各种操作,包括表单验证。 1、将基于Jquery的表单验证的调查问卷分为四个部分:FrontPage.html、write....

    jQuery - 3.6.0

    jQuery 是一个快速、小巧且功能丰富的 JavaScript 库。它使HTML文档遍历和操作,事件处理,动画和Ajax等功能变得更加简单,它具有易于使用的API,可跨多种浏览器运行。凭借多功能性和可扩展性的结合,jQuery改变了数...

    jquery-3.7.0.min.js(jQuery下载)

    jquery-3.7.0.min.js(jQuery下载)jquery-3.7.0.min.js(jQuery下载)jquery-3.7.0.min.js(jQuery下载)jquery-3.7.0.min.js(jQuery下载)jquery-3.7.0.min.js(jQuery下载)jquery-3.7.0.min.js(jQuery下载)...

    jquery-3.6.0.js 和 jquery-3.6.0.min.js 【jquery-3.6.0包合集】

    jquery-3.6.0.js 和 jquery-3.6.0.min.js 【jquery-3.6.0包合集】 jquery-3.6.0包合集下载 包含: jquery-3.6.0.js jquery-3.6.0.min.js jQuery是一个快速、简洁的JavaScript框架,封装JavaScript常用的功能代码,...

    jquery-3.3.1.js和jquery-3.3.1.min.js

    jquery-3.3.1.js和jquery-3.3.1.min.js免费下载哈。jquery-3.3.1.js和jquery-3.3.1.min.js免费下载哈。jquery-3.3.1.js和jquery-3.3.1.min.js免费下载哈。jquery-3.3.1.js和jquery-3.3.1.min.js免费下载哈。jquery-...

    jQuery-3.5.1压缩版

    jQuery-3.5.1压缩版

    jquery-3.6.4.js

    jquery-3.6.4.js

    jquery.min.js 3.6.4版本

    jQuery设计的宗旨是“write Less,Do More”,即倡导写更少的代码,做更多的事情。它封装JavaScript常用的功能代码,提供一种简便的JavaScript设计模式,优化HTML文档操作、事件处理、动画设计和Ajax交互。 jQuery的...

    jquery-migrate

    jQuery 迁移插件, Migrate 有两个版本。jquery-migrate-1.4.1版本将帮助您将 1.9 之前的 jQuery 代码更新到 jQuery 1.9 到 3.0。 jquery-migrate-3.4.0版本将帮助您更新代码以在 jQuery 3.0 或更高版本上运行。 ...

    下载jquery-3.3.1.min.js

    下载jquery-3.3.1.min.js

    jquery-1.9.1.js

    jquery-1.9.1版本

    前端+jQuery+实现烟花特效

    前端+jQuery+实现烟花特效前端+jQuery+实现烟花特效前端+jQuery+实现烟花特效前端+jQuery+实现烟花特效前端+jQuery+实现烟花特效前端+jQuery+实现烟花特效前端+jQuery+实现烟花特效前端+jQuery+实现烟花特效前端+...

    jQuery源码 jQuery源码 jQuery源码

    jQuery源码jQuery源码jQuery源码jQuery源码jQuery源码jQuery源码jQuery源码jQuery源码jQuery源码jQuery源码jQuery源码jQuery源码jQuery源码jQuery源码jQuery源码jQuery源码jQuery源码jQuery源码jQuery源码jQuery源码...

    jquery-1.10.2.js

    贪吃蛇 (2)

    jquery验证码

    jQuery实现web开发验证码,无需后台验证。简单方便实用

    Jquery-3.7.1.min.js

    Jquery-3.7.1.min.js

    jquery-1.12.4.zip下载

    《jQuery 1.12.4:高效前端开发的得力助手》 jQuery,作为一款广泛使用的JavaScript库,自2006年发布以来,便以其简洁的API和强大的功能深受开发者喜爱。在这个标题为“jquery-1.12.4.zip”的压缩包中,包含的是...

    Jquery 本地版引用文件 适配3.6.1版本

    &lt;script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.6.1.min.js"&gt; 官网jquery压缩版引用地址: &lt;script src="https://code.jquery.com/jquery-3.6.1.min.js"&gt;&lt;/script&gt; 下载后更改文件名,匹配引用连接...

    jQuery1.11.0_20140330_jquery_

    jQuery是一个JavaScript函数库。jQuery是一个轻量级的&quot;写的少,做的多&quot;的JavaScript库。jQuery库包含以下功能: HTML 元素选取 HTML 元素操作 CSS 操作 HTML 事件函数 JavaScript 特效和动画 HTML DOM ...

Global site tag (gtag.js) - Google Analytics