国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 語言 > JavaScript > 正文

Jquery 實現Tab效果 思路是js思路

2024-05-06 14:11:16
字體:
來源:轉載
供稿:網友
代碼如下:
<!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.Vevb.com/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>m.survivalescaperooms.com</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.Vevb.com/js/jquery_tab/index.htm
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 台山市| 泸州市| 贵港市| 泾川县| 新乐市| 沙坪坝区| 兴业县| 轮台县| 平原县| 西乡县| 石门县| 白山市| 梅河口市| 翁牛特旗| 潞西市| 中牟县| 靖远县| 晋城| 清远市| 武义县| 望都县| 隆回县| 蓝田县| 昌平区| 嘉兴市| 芜湖县| 通辽市| 济宁市| 大埔区| 基隆市| 翁源县| 营口市| 闻喜县| 杨浦区| 石棉县| 霍州市| 漳浦县| 东源县| 孝义市| 丁青县| 旌德县|