当时做这个的时候,当前状态是不规则的,li对应的有3块内容,分别设定不同背景图片,只显示当前的一个背景,鼠标移上去的时候其余2个用background-position: -1000px 0px;来隐藏,用jquery找到他的同辈给有一个样式background-position: 0px 0px;

html部分:

<div class="gold_list">
<ul>
<li class="ino_a hover" style="background-position:0 0;">1.填写详细信息</li>
<li class="ino_b" >2.确定保单信息</li>
<li class="ino_c">3.支付</li>
</ul>
</div>
<div class="table_gold2">
<div class="table_conter" >
1111111111
</div>
<div class="table_conter" style="display:none; height: 300px; background: green;">222222222222</div>
<div class="table_conter" style="display:none; height: 600px; background: blue;">33333333333333</div>
</div>

css部分:
 <style>
* { margin:; padding:; }
.gold_list{width:945px; height:48px; margin:auto; padding-top: 30px;}
.gold_list ul{position:relative; height:48px;}
.gold_list ul li{ line-height:48px; cursor:pointer; float:left; position:absolute;text-align:center;
color:#333333; font-size:16px; top:0px;}
.gold_list ul .ino_a{ left:0px;}
.gold_list ul .ino_b{ left:315px;}
.gold_list ul .ino_c{ left:630px;}
.gold_list ul .ino_a, .gold_list ul .ino_b, .gold_list ul .ino_c,
.gold_list ul .ino_a.hover, .gold_list ul .ino_b.hover, .gold_list ul .ino_c.hover
{width:315px; height:48px;font-weight:bold;">#f5f5f5;background-repeat: no-repeat;
background-position: -1000px 0px;overflow: hidden;}
.gold_list ul .hover{color: #ffffff;}
.gold_list ul .ino_a{background-image:url(images/c.png); }
.gold_list ul .ino_b{background-image:url(images/ba.png);}
.gold_list ul .ino_c{background-image:url(images/a.png);}
.table_gold2, .table_conter{width:945px; height: auto; overflow: hidden; margin:auto;}
</style>
jquery部分:
//tab 切换
$(function(){
$('.gold_list li').mouseover(function() {
$(this).addClass('hover');
$(this).siblings().removeClass('hover');
$(this).siblings().attr("style",""); //属性值,可设置
$(this).css("background-position","0px 0px");
$('.table_conter').eq($(this).index()).show().siblings().hide();
})
})

效果图:

不明白的伙伴可自行下载查看:

链接: http://pan.baidu.com/s/1o7Wnk2Q 密码: 72k8

一款jquery写出来的tab切换的更多相关文章

  1. jquery实现简单的Tab切换菜单

    实现tab切换的主要html代码: <div class="container"> <ul class="tabs"> <li c ...

  2. jquery 选项卡切换、选项卡封装、简单的jquery选项卡封装、tab切换效果

    相信选项卡切换是大家常用的效果单独写一个选项卡切换很方便但是要是一个页面出现多个选项卡不做封装的话会显得代码很杂乱 <div class="bodyCenter"> & ...

  3. 利用jquery写的一个TAB页切换效果

    函数如下 /** *切换效果 */ function switab(tab,con,tab_c_css,tab_n_css,no) { $(tab).each(function(i){ if(i == ...

  4. jQuery 写的幻灯左右切换插件

    <html> <head> <meta charset="utf-8"> <title>官网</title> <s ...

  5. Jquery实现下拉tab切换

    //需求:分别点击html,css,js元素时展示对应的列表内容,其他列表内容要自动收起来 //代码如下 <!DOCTYPE html> <html lang="en&qu ...

  6. jQuery实现简单的tab切换

    html: <section>   <nav id="nav">     <a class="on">tab1</a& ...

  7. jquery写简单的div切换

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  8. jQuery带小图标的Tab切换焦点图

    在线演示 本地下载

  9. 手机端的tab切换,响应式切换效果

    之前写过这些tab切换的效果,无论网页上还是手机端,网上也有很多的例子,这个好像是我参考网上,也不知道是哪里的了.总结了一下,就当保存下来了把. <!DOCTYPE html > < ...

随机推荐

  1. Spark_Api_图解

  2. 深入理解 GCD

    前言 首先提出一些问题: dispatch_async 函数如何实现,分发到主队列和全局队列有什么区别,一定会新建线程执行任务么? dispatch_sync 函数如何实现,为什么说 GCD 死锁是队 ...

  3. JAVA实现DES加密

    DES加密介绍       DES是一种对称加密算法,所谓对称加密算法即:加密和解密使用相同密钥的算法.DES加密算法出自IBM的研究,后来被美国政府正式采用,之后开始广泛流传,但是近些年使用越来越少 ...

  4. CSS skills: 5) jquery hover(over,out)

    $(":div[name=div_edit]").each(function() { $(this).hover(function() { $(this).find("& ...

  5. python(5)- sys.stdout()实现进度条

    1. 使用\r , 让其始终在行首输出,实现进度条 import sys, time ''' 使用\r 来实现进度条的效果,\r 是光标移到行首但不换行. 假设文件大小为60,一下下载1, 下载到60 ...

  6. javaweb学习总结十四(xml约束之Schema)

    一:schema约束简单介绍 1:xml Schema的定义以及优缺点 2:xml schema入门 3:命名空间 这里http://www.itcast.cn 并没有什么具体的意义,只是命名而已. ...

  7. [改善Java代码]覆写equals方法时不要识别不出自己

    建议45: 覆写equals方法时不要识别不出自己 我们在写一个JavaBean时,经常会覆写equals方法,其目的是根据业务规则判断两个对象是否相等,比如我们写一个Person类,然后根据姓名判断 ...

  8. C#电脑自动关机代码指令

    Process p = new Process();//实例化一个独立进程                p.StartInfo.FileName = "cmd.exe";//进程 ...

  9. C#/.NET使用HttpWebRequest、SqlBulkCopy从API获取数据批量插入DB

    小弟新手程序员一枚,代码技术和文章水平均不才.所写文章均为对自己所写所学代码的简单记录,可能对于老手程序员营养价值不高,望莫见怪. 我工作上有个需求:从某处API接口上获取数据(大约1W条而已)并插入 ...

  10. ActiveMQ(5.10.0) - Configuring the Simple Authentication Plug-in

    The easiest way to secure the broker is through the use of authentication credentials placed directl ...