码迷,mamicode.com
首页 > 其他好文 > 详细

tab页签

时间:2019-08-14 12:42:05      阅读:124      评论:0      收藏:0      [点我收藏+]

标签:lis   each   com   就业   事业   news   sel   webp   ndis   

<div class="fl" id="newsBox">
<div class="tab1 grayBar">
<ul id="newsNav">
<li class="tab1_1 selected" index="0">
<h2>
<a href="WebPage/NewsList.aspx?CategoryID=221" target="_blank" title="更多">公告栏</a></h2>
</li>
<li class="tab1_2" index="1">
<h2>
<a href="WebPage/Scene.aspx" target="_blank" title="点击显示更多招聘会信息">招聘会</a></h2>
</li>
<li class="tab1_3" index="2">
<h2>
<a href="http://www.gxrcpx.com/" target="_blank">就业培训</a></h2>
</li>
<li class="tab1_4" index="3">
<h2>
<a href="http://sydw.gxrc.com" target="_blank" title="更多">事业单位</a></h2>
</li>
<li class="tab1_5" index="4">
<h2>地市动态</h2>
</li>

</ul>
</div>
<div id="NewsArea-content" class="cl base_border">
<div class="newsList">



</div>
<div class="newsList undis">



</div>
<div class="newsList undis">



</div>
<div class="newsList undis">



</div>
<div class="newsList undis">



</div>
<div class="newsList undis" style="display:none;">



</div>
</div>

</div>

 

 

//页签
function Tabs(tabNav, tabContent, selClass) {
var index = 0;
var tabContents = $("#" + tabContent + " > div");
var tabNavs = $("#" + tabNav + " li");
tabNavs.each(function () {
var $this = $(this);
$this.attr("index", index);
index++;
}).mouseover(function () {
var $this = $(this);
tabContents.hide();
tabNavs.removeClass(selClass);
$this.addClass(selClass);
tabContents.eq(parseInt($this.attr("index"))).show();
});
}
Tabs("newsNav", "NewsArea-content", "selected");

tab页签

标签:lis   each   com   就业   事业   news   sel   webp   ndis   

原文地址:https://www.cnblogs.com/sunnywindycloudy/p/11351081.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!