富贵资源网 Design By www.hznty.com
复制代码 代码如下:
<!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>Jquery的Tabs内容轮换效果实现代码,几行搞定</title>
<script language="javascript" type="text/javascript" src="/UploadFiles/2021-04-02/jquery-1.4.4.min.js"> <style type="text/css">
* { margin:0; padding:0;}
body { font:12px Verdana, Geneva, sans-serif; color:#404040;}
.tabs { margin:10px 0 0 20px; width:360px; position:relative; overflow:hidden; height:1%; height:160px;}
.tabs span { z-index:2; font-size:12px; border:1px solid #d5d5d5; width:95px; height:25px; line-height:25px; text-align:center; float:left; margin-right:5px; cursor:pointer;}
span.active { background-position:0 -25px; background-color:#d5d5d5;}
#tab-01, #tab-02, #tab-03 { position:absolute; top:26px; left:0; width:338px; padding:10px; height:93px; border:1px solid #d5d5d5; z-index:1;}
#tab-02, #tab-03 { display:none;}
</style>
<script type="text/javascript">
$(document).ready(function () {
$('.tabs span').mouseover(function () {
//div隐藏
$('.tabs div').hide();
//查找.tabs span同辈元素span 后面紧邻的同辈元素div显示
$(this).siblings('span').removeClass('active').end().addClass('active').next('div').show();
});
});
</script>
</head>
<body>
<div class="tabs">
<!-- 默认第一个tab为激活状态 -->
<span class="active">热点新闻</span>
<div id="tab-01">news</div>
<span>娱乐新闻</span>
<div id="tab-02">enteriment</div>
<span>就业形势</span>
<div id="tab-03">jobs</div>
</div>
</body>
</html>
<!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>Jquery的Tabs内容轮换效果实现代码,几行搞定</title>
<script language="javascript" type="text/javascript" src="/UploadFiles/2021-04-02/jquery-1.4.4.min.js"> <style type="text/css">
* { margin:0; padding:0;}
body { font:12px Verdana, Geneva, sans-serif; color:#404040;}
.tabs { margin:10px 0 0 20px; width:360px; position:relative; overflow:hidden; height:1%; height:160px;}
.tabs span { z-index:2; font-size:12px; border:1px solid #d5d5d5; width:95px; height:25px; line-height:25px; text-align:center; float:left; margin-right:5px; cursor:pointer;}
span.active { background-position:0 -25px; background-color:#d5d5d5;}
#tab-01, #tab-02, #tab-03 { position:absolute; top:26px; left:0; width:338px; padding:10px; height:93px; border:1px solid #d5d5d5; z-index:1;}
#tab-02, #tab-03 { display:none;}
</style>
<script type="text/javascript">
$(document).ready(function () {
$('.tabs span').mouseover(function () {
//div隐藏
$('.tabs div').hide();
//查找.tabs span同辈元素span 后面紧邻的同辈元素div显示
$(this).siblings('span').removeClass('active').end().addClass('active').next('div').show();
});
});
</script>
</head>
<body>
<div class="tabs">
<!-- 默认第一个tab为激活状态 -->
<span class="active">热点新闻</span>
<div id="tab-01">news</div>
<span>娱乐新闻</span>
<div id="tab-02">enteriment</div>
<span>就业形势</span>
<div id="tab-03">jobs</div>
</div>
</body>
</html>
富贵资源网 Design By www.hznty.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
富贵资源网 Design By www.hznty.com
暂无评论...