<!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. ACM3787

    /* 问题说明 给定两个整数A和B,其表示形式是:从个位开始, 每三位数用逗号","隔开. 现在请计算A+B的结果,并以正常形式输出. 输入 输入包含多组数据数据,每组数据占一行, ...

  2. centos6.5建立cloudera-cdh4.6本地源

    1.准备:      centos6.5系统,root用户 2.安装所需包:      sudo yum install yum-utils createrepo 3.下载cdh4.6的repo:   ...

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

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

  4. [工具] slf4j-api、slf4j-log4j12以及log4j之间的关系

    几乎在每个jar包里都可以看到log4j的身影,在多个子工程构成项目中,slf4j相关的冲突时不时就跳出来让你不爽,那么slf4j-api.slf4j-log4j12还有log4j是什么关系?     ...

  5. MyEclipe10中集成Tomcat7

    1.MyEclipse|Servers|Tomcat|Tomcat 7.x 2.Enable 3.Browse:D:\Tomcat 7.0 4.JDK:下拉选择JDK7.0,注意:千万不能在此处右键A ...

  6. matches()方法

    java.lang包中的String类和java.util.regex包中的Pattern,Matcher类中都有matches()方法,都与正则表达式有关.下面我分别举例:(字符串:"ab ...

  7. 读书笔记-《基于Oracle的SQL优化》-第一章-3

    优化器: 1.优化器的模式: 用于决定在Oracle中解析目标SQL时所用优化器的类型,以及决定当使用CBO时计算成本值的侧重点.这里的“侧重点”是指当使用CBO来计算目标SQL各条执行路径的成本值时 ...

  8. Linux 操作系统位数(32or64)识别

    Linux 操作系统位数识别: LINUX 32位操作系统:Linux x86   i586  i386  i686 i... LINUX 64位操作系统:Linux x64x86_64  X64 . ...

  9. PNP8550(3.3V DC蜂鸣器) - 原理图系列

    一.截图 watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQveGlhb2Jpbl9ITEo4MA==/font/5a6L5L2T/fontsize/400/fi ...

  10. 关于PHP定时执行任务的实现(转)

    PHP在这方面应该说是比较弱,如果只用php去实现可以如下: <?php ignore_user_abort();//关闭浏览器后,继续执行php代码 set_time_limit(0);//程 ...