色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

Jquery 實現(xiàn)Tab效果 思路是js思路

復制代碼 代碼如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="http://img.jb51.NET/jslib/jquery/jquery.js" type="text/Javascript"></script>
<style type="text/css">
.tab
{
background-color: #FAFAFA;
margin: 5px 8px;
padding: 5px 10px;
}
.tab p span
{
background-color: #EFEFEF;
border: 1px solid #CCCCCC;
cursor: pointer;
margin-right: 6px;
padding: 2px 5px;
}
.tab p span.current
{
background-color: #FAFAFA;
border-bottom-color: #fafafa;
}
.tab p
{
border-bottom: 1px solid #CCCCCC;
font-weight: bold;
padding: 0 10px 2px;
}
.tab li
{
border-bottom: 1px dotted #CCCCCC;
padding-bottom: 3px;
margin: 5px 0;
}
.tab .mhot, .tab.allhot
{
display: none;
}
</style>
<script type="text/Javascript">
$(document).ready(function() {
$(".tab span:first").addClass("current"); //為第一個SPAN添加當前效果樣式
$(".tab ul:not(:first)").hide(); //隱藏其它的UL
$(".tab span").mouseover(function() {
$(".tab span").removeClass("current"); //去掉所有SPAN的樣式
$(this).addClass("current");
$(".tab ul").hide();
$("." + $(this).attr("id")).fadeIn('slow');
});
});
</script>
</head>
<body>
<div class="tab">
<p>
<span id="tab1">tab1</span> <span id="tab2">tab2</span> <span id="tab3">tab3</span></p>
<ul class="tab1">
<li>腳本之家</li><li>www.jb51.NET</li><li>我和我</li></ul>
<ul class="tab2">
<li>一花一世辦</li><li>一草一天堂</li></ul>
<ul class="tab3">
<li>阿里巴巴</li><li>阿里巴巴</li><li>一草一天堂</li><li>我和我的祖國</li><li>最愛的地方</li></ul>
</div>
</body>
</html>

演示代碼 http://demo.jb51.NET/js/jquery_tab/index.htm

JavaScript技術Jquery 實現(xiàn)Tab效果 思路是js思路,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 泗阳县| 神农架林区| 利津县| 温泉县| 雷州市| 巴中市| 广饶县| 革吉县| 噶尔县| 四川省| 安溪县| 定陶县| 桓台县| 桐梓县| 来宾市| 阿克苏市| 达拉特旗| 邵东县| 彰化市| 溧水县| 浦县| 冷水江市| 慈利县| 南漳县| 铅山县| 泰宁县| 高邮市| 江源县| 昌图县| 文山县| 扶绥县| 石楼县| 中方县| 化德县| 中江县| 稷山县| 泌阳县| 迭部县| 榆林市| 阳原县| 怀宁县|