<!DOCTYPE html>
<html>
<head>
<script src="/jquery/jquery-1.11.1.min.js"></script>
<script>
$(document).ready(function(){ $("#a").mouseover(function(){
$(this).css("background-color","yellow");
$(this).siblings().css("background-color","white");
$("p").css('display','none');
$("#po").css('display','block');
});
$("#b").mouseover(function(){
$(this).css("background-color","yellow");
$(this).siblings().css("background-color","white"); $("p").css('display','none');
$("#po1").css('display','block');
});
$("#c").mouseover(function(){
$(this).css("background-color","yellow");
$(this).siblings().css("background-color","white"); $("p").css('display','none');
$("#po2").css('display','block');
});
});
</script>
</head> <body>
<h2 id='a' >这是标题1</h2>
<h2 id='b'>这是标题2</h2>
<h2 id='c' >这是标题23</h2>
<p id='po' style="background-color:#ff0000">这是一个段落23。</p>
<p id='po1' style="background-color:#00ff00">这是一个段落2222。</p>
<p id='po2' style="background-color:#0000ff">这是一个段落。2222222</p>
<button>返回 p 元素的背景色</button>
</body>
</html>

简易版

<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
<script>
$(document).ready(function(){ $("#a").mouseover(function(){
$(this).css("background-color","yellow");
$(this).siblings().css("background-color","white");
$(".conlist").css('display','none');
$("#aa").css('display','block');
});
$("#b").mouseover(function(){
$(this).css("background-color","yellow");
$(this).siblings().css("background-color","white"); $(".conlist").css('display','none');
$("#bb").css('display','block');
});
$("#c").mouseover(function(){
$(this).css("background-color","yellow");
$(this).siblings().css("background-color","white"); $(".conlist").css('display','none');
$("#cc").css('display','block');
});
$("#d").mouseover(function(){
$(this).css("background-color","yellow");
$(this).siblings().css("background-color","white"); $(".conlist").css('display','none');
$("#dd").css('display','block');
});
});
</script> <div style="margin-top:4px;">
<ul class="news_tab" id="tab1">
<a id="a" href="http://www.ky007.com/kyxw/"><li class="selected" onmouseover="setTab(1,0,'selected','normal');" title="考研新闻">考研新闻</li></a>
<a id="b" href="bkxx/bkzn/"><li class="normal" onmouseover="setTab(1,1,'selected','normal');" title="报考指南">报考指南</li></a>
<a id="c" href="/kycs/"><li class="normal" onmouseover="setTab(1,2,'selected','normal');" title="考研常识">考研常识</li></a>
<a id="d" href="/kyzc/"><li class="normal" onmouseover="setTab(1,3,'selected','normal');" title="考研政策">考研政策</li></a>
</ul> <div id="tablist1">
<div class="conlist" id="aa"> <div class="ky_newsimg">
<a href="/2013/1030/24111.html" title="【大学毕业季】选择考研还是工作?" target="_blank"><img src="http://www.ky007.com/uploadfile/2013/1031/thumb_144_0_20131031094729199.jpg" width="144" height="94"/></a>
</div>
<div class="ky_newsp" >
<h3><a href="/2013/1030/24111.html" target="_blank">【大学毕业季】选择考研还是工</a></h3>
<p>站在人生的十字路口,选择考研还是工作,一直困扰着大学...<a href="/2013/1030/24111.html" target="_blank">更多>></a></p>
</div> <ul style="float:left; width:390px; padding-right:5px; line-height:24px;">
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">03-27</span>·<a href="/2014/0327/25371.html" target="_blank" style="font-size:14px; color:#000000; ">【求职加油站】女生面试怎么穿?</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">03-13</span>·<a href="/2014/0313/25308.html" target="_blank" style="font-size:14px; color:#000000; ">我国硕士研究生的4种分类方法</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">02-27</span>·<a href="/2014/0227/25223.html" target="_blank" style="font-size:14px; color:#000000; ">考研择校择专业:丛不同角度对比分析</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">02-27</span>·<a href="/2014/0227/25222.html" target="_blank" style="font-size:14px; color:#000000; ">2015考研:算清楚考研这笔账</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">02-27</span>·<a href="/2014/0227/25221.html" target="_blank" style="font-size:14px; color:#000000; ">考研必备相关二十件事</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">02-27</span>·<a href="/2014/0227/25220.html" target="_blank" style="font-size:14px; color:#000000; ">充分利用真题复习</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">02-27</span>·<a href="/2014/0227/25219.html" target="_blank" style="font-size:14px; color:#000000; ">考研复习资料搜集</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">02-27</span>·<a href="/2014/0227/25218.html" target="_blank" style="font-size:14px; color:#000000; ">2015考研复习:"高学历"是否等于"高报酬"?</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">02-27</span>·<a href="/2014/0227/25217.html" target="_blank" style="font-size:14px; color:#000000; "> 2015考研寒假复习建议</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">01-23</span>·<a href="/2014/0123/25069.html" target="_blank" style="font-size:14px; color:#000000; ">如何顺利通过考研英语词汇难关</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">01-23</span>·<a href="/2014/0123/25068.html" target="_blank" style="font-size:14px; color:#000000; ">2015考研:考研英语复习中常犯的错误</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">01-23</span>·<a href="/2014/0123/25067.html" target="_blank" style="font-size:14px; color:#000000; ">如何在考研复习过程中提高考研英语水平?</a></li>
</ul>
</div>
<div class="conlist" style="display:none" id="bb">
<ul style="float:left; width:390px; padding-right:5px; line-height:24px;">
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">03-27</span>·<a href="/2014/0327/25371.html" target="_blank" style="font-size:14px; color:#000000; ">【求职加油站】女生面试怎么穿?</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">03-13</span>·<a href="/2014/0313/25308.html" target="_blank" style="font-size:14px; color:#000000; ">我国硕士研究生的4种分类方法</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">02-27</span>·<a href="/2014/0227/25223.html" target="_blank" style="font-size:14px; color:#000000; ">考研择校择专业:丛不同角度对比分析</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">02-27</span>·<a href="/2014/0227/25222.html" target="_blank" style="font-size:14px; color:#000000; ">2015考研:算清楚考研这笔账</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">02-27</span>·<a href="/2014/0227/25221.html" target="_blank" style="font-size:14px; color:#000000; ">考研必备相关二十件事</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">02-27</span>·<a href="/2014/0227/25220.html" target="_blank" style="font-size:14px; color:#000000; ">充分利用真题复习</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">02-27</span>·<a href="/2014/0227/25219.html" target="_blank" style="font-size:14px; color:#000000; ">考研复习资料搜集</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">02-27</span>·<a href="/2014/0227/25218.html" target="_blank" style="font-size:14px; color:#000000; ">2015考研复习:"高学历"是否等于"高报酬"?</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">02-27</span>·<a href="/2014/0227/25217.html" target="_blank" style="font-size:14px; color:#000000; "> 2015考研寒假复习建议</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">01-23</span>·<a href="/2014/0123/25069.html" target="_blank" style="font-size:14px; color:#000000; ">如何顺利通过考研英语词汇难关</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">01-23</span>·<a href="/2014/0123/25068.html" target="_blank" style="font-size:14px; color:#000000; ">2015考研:考研英语复习中常犯的错误</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">01-23</span>·<a href="/2014/0123/25067.html" target="_blank" style="font-size:14px; color:#000000; ">如何在考研复习过程中提高考研英语水平?</a></li>
</ul>
</div>
<div class="conlist" style="display:none" id="cc">
<ul style="float:left; width:390px; padding-right:5px; line-height:24px;"> <li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">02-27</span>·<a href="/2014/0227/25221.html" target="_blank" style="font-size:14px; color:#000000; ">考研必备相关二十件事</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">02-27</span>·<a href="/2014/0227/25220.html" target="_blank" style="font-size:14px; color:#000000; ">充分利用真题复习</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">02-27</span>·<a href="/2014/0227/25219.html" target="_blank" style="font-size:14px; color:#000000; ">考研复习资料搜集</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">02-27</span>·<a href="/2014/0227/25218.html" target="_blank" style="font-size:14px; color:#000000; ">2015考研复习:"高学历"是否等于"高报酬"?</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">02-27</span>·<a href="/2014/0227/25217.html" target="_blank" style="font-size:14px; color:#000000; "> 2015考研寒假复习建议</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">01-23</span>·<a href="/2014/0123/25069.html" target="_blank" style="font-size:14px; color:#000000; ">如何顺利通过考研英语词汇难关</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">01-23</span>·<a href="/2014/0123/25068.html" target="_blank" style="font-size:14px; color:#000000; ">2015考研:考研英语复习中常犯的错误</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">01-23</span>·<a href="/2014/0123/25067.html" target="_blank" style="font-size:14px; color:#000000; ">如何在考研复习过程中提高考研英语水平?</a></li>
</ul>
</div>
<div class="conlist" style="display:none" id="dd">
<ul style="float:left; width:390px; padding-right:5px; line-height:24px;"> <li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">02-27</span>·<a href="/2014/0227/25223.html" target="_blank" style="font-size:14px; color:#000000; ">考研择校择专业:丛不同角度对比分析</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">02-27</span>·<a href="/2014/0227/25222.html" target="_blank" style="font-size:14px; color:#000000; ">2015考研:算清楚考研这笔账</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">02-27</span>·<a href="/2014/0227/25221.html" target="_blank" style="font-size:14px; color:#000000; ">考研必备相关二十件事</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">02-27</span>·<a href="/2014/0227/25220.html" target="_blank" style="font-size:14px; color:#000000; ">充分利用真题复习</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">02-27</span>·<a href="/2014/0227/25219.html" target="_blank" style="font-size:14px; color:#000000; ">考研复习资料搜集</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">02-27</span>·<a href="/2014/0227/25218.html" target="_blank" style="font-size:14px; color:#000000; ">2015考研复习:"高学历"是否等于"高报酬"?</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">02-27</span>·<a href="/2014/0227/25217.html" target="_blank" style="font-size:14px; color:#000000; "> 2015考研寒假复习建议</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">01-23</span>·<a href="/2014/0123/25069.html" target="_blank" style="font-size:14px; color:#000000; ">如何顺利通过考研英语词汇难关</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">01-23</span>·<a href="/2014/0123/25068.html" target="_blank" style="font-size:14px; color:#000000; ">2015考研:考研英语复习中常犯的错误</a></li>
<li style="float:left; text-align:left; width:390px; color:#C1C1C1;"><span class="rt" style="font-size:14px;">01-23</span>·<a href="/2014/0123/25067.html" target="_blank" style="font-size:14px; color:#000000; ">如何在考研复习过程中提高考研英语水平?</a></li>
</ul>
</div>
</div>
</div>

jquery 自定义tab的更多相关文章

  1. jquery自定义插件——以 选项卡插件为例

    一直打算尝试自定义插件,终于付诸实践了,现在把内容发表出来,与大家共勉. 我是根据自己正在用的插件,模仿其源码,实现的自定义插件,完成之后,在网上看相关资料,对自定义插件部分,有了更明确的认识. jq ...

  2. jQuery自定义滚动条样式插件mCustomScrollbar

    如果你构建一个很有特色和创意的网页,那么肯定希望定义网页中的滚动条样式,这方面的 jQuery 插件比较不错的,有两个:jScrollPane 和 mCustomScrollbar. 关于 jScro ...

  3. 使用jQuery开发tab选项卡插件(可以右键关闭多个标签)

    在前一篇“使用jQuery开发tab选项卡插件”的基础上添加了tab标签右键关闭菜单功能,菜单主要包括:关闭当前标签.关闭左侧标签.关闭右侧标签.关闭其他.关闭全部. 一.插件效果 二.实现思路 为w ...

  4. 深入学习jQuery自定义插件

    原文地址:jQuery自定义插件学习 1.定义插件的方法 对象级别的插件扩展,即为jQuery类的实例增加方法, 调用:$(选择器).函数名(参数);      $(‘#id’).myPlugin(o ...

  5. jquery自定义滚动条 鼠标移入或滚轮时显示 鼠标离开或悬停超时时隐藏

    一.需求: 我需要做一个多媒体播放页面,左侧为播放列表,右侧为播放器.为了避免系统滚动条把列表和播放器隔断开,左侧列表的滚动条需要自定义,并且滚动停止和鼠标离开时要隐藏掉. 二.他山之石: 案例来自h ...

  6. jquery实现tab切换完整代码

    代码如下,保存到html文件打开: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " ...

  7. jQuery自定义漂亮的下拉框插件8种效果演示

    原始的下拉框不好看这里推荐一个jQuery自定义漂亮的下拉框插件8种效果演示 在线预览 下载地址 实例代码 <!DOCTYPE html> <html lang="en&q ...

  8. jQuery自定义插件

    jQuery自定义插件 jQuery自定义插件按照功能分类,可以分为三类, 1>封装对象方法的插件,(也就是基于某个DOM元素的jQuery对象,局部的) 2>封装全局函数的插件,   ( ...

  9. Jquery自定义扩展方法(二)--HTML日历控件

    一.概述 研究了上节的Jquery自定义扩展方法,自己一直想做用jquery写一个小的插件,工作中也用到了用JQuery的日历插件,自己琢磨着去造个轮子--HTML5手机网页日历控件,废话不多说,先看 ...

随机推荐

  1. OpenStack G版以后的Availability Zone与Aggregate Hosts

    关于Availability Zone与Aggregate Hosts的概念解析,可以参考这篇文章:http://blog.chinaunix.net/uid-20940095-id-3875022. ...

  2. 最常用的 Eclipse 快捷键总结

    本文是一些最实用.最齐全.最省时间的 Eclipse 快捷键总结,这些快捷键可以让帮助你完成工作中的任何一个操作.欢迎参考. 1. ctrl+shift+r:打开资源 这可能是所有快捷键组合中最省时间 ...

  3. hdoj 1285 确定比赛名次【拓扑排序】

    确定比赛名次 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Subm ...

  4. QUEUE——队列(procedure)

    #include <stdio.h> #include <stdlib.h> #include "queue.h" int main() {  int i; ...

  5. 手把手教你mysql(十)索引

    手把手教你mysql(十)索引 一:索引的引入 索引定义:索引是由数据库表中一列或者多列组合而成,其作用是提高对表中数据的查询速度. 类似于图书的目录,方便快速定位,寻找指定的内容,如一本1000页的 ...

  6. Android(java)学习笔记201:网络图片浏览器的实现(ANR)

    1.我们在Android下,实现使用http协议进行网络通信,请求网络数据.这里是获取网络上的图片信息,让它可以显示在手机上: 但是我们这个手机连接网络是很费时间,如果我们在主线程(UI线程)中写这个 ...

  7. 表达式:使用API创建表达式树(6)

    一.ConstantExpression:表示具有常量值的表达式.因为表达式应用过程中,参数据多是 Expressions 类型,算是对常量值的一种包装吧. ConstantExpression使用比 ...

  8. WPF TextElement内容模型简介(转)

    本内容模型概述描述了 TextElement 支持的内容. Paragraph 类是 TextElement 的类型. 内容模型描述哪些对象/元素可以包含在其他对象/元素中. 本概述汇总了派生自 Te ...

  9. 实现正在加载中界面的Android库:DynamicBox

    转载. DynamicBox是一个Android库,能够inflates自定义布局来指示出: 正在加载内容 显示一个异常 或者是一个自定义视图     项目主页:http://www.open-ope ...

  10. bash: ./configure: 权限不够 怎么办?

    configure没有执行权限 通过chmod给其加上x权限 chmod +x configure 再在该用户下执行 ./configure