<!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. poj 3465 Corn Fields 状态压缩

    题目链接:http://poj.org/problem?id=3254 #include <cstdio> #include <cstring> #include <io ...

  2. 南京Uber优步司机奖励政策(1月25日~1月31日)

    滴快车单单2.5倍,注册地址:http://www.udache.com/ 如何注册Uber司机(全国版最新最详细注册流程)/月入2万/不用抢单:http://www.cnblogs.com/mfry ...

  3. 炮兵阵地 - POJ 1185(状态压缩)

    分析:先枚举出来所有的合法状态(当N=10的时候合法状态最多也就60种),用当前状态匹配上一行和上上一行的状态去匹配,看是否可以.....复杂度100*60*60*60,也可以接受. 代码如下: == ...

  4. UVa12063 Zeros and Ones

    神坑 1竟然还要取模 在后面填数多好的 #include<cstdio> #include<cstring> #include<cstdlib> #include& ...

  5. C#类型 分类: C# 2015-03-09 08:44 202人阅读 评论(0) 收藏

    C# 类型 引言 本文之初的目的是讲述设计模式中的 Prototype(原型)模式,但是如果想较清楚地弄明白这个模式,需要了解对象克隆(Object Clone),Clone其实也就是对象复制.复制又 ...

  6. input标签上传图片怎么获取src;

    大家都知道input标签可以上传文件 如: <input type="file"/> 就可以上传文件,当然也可以上传图片,上传的图片的src地址如何取到: var re ...

  7. (转)百度Map API

    转自  http://blog.sina.com.cn/s/blog_6079f38301013sb3.html 一.与地图操作相关的接口哦! (这些接口的开启都是写在执行成功的回调函数那里) map ...

  8. Linux sed命令常用方法

    sed也成stream editor,流编辑器,是Linux上常用的文本处理工具. 通用格式:sed  行范围  模式/RegExp/  文件 模式: d 删除 p 打印符合条件的行 a \strin ...

  9. PHP获取文件行数

    原文出处 提供两种实现方法,但是第一种效率最好 第一种: <?php $file_path = 'test.txt'; //文件路径 此处找一个1094644行的TXT文件 test.txt $ ...

  10. 利用MutationObserver对页面元素的改变进行监听

    'use strict'; let MutationObserver = window.MutationObserver || window.WebKitMutationObserver || win ...