当前位置: 首页 > 编程日记 > 正文

动感效果的TAB选项卡 jquery 插件

QQ截图20110709155330

动感效果的TAB选项卡 jquery 插件

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link  href="tab.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="tab.js"></script>
<script type="text/javascript">
$(function() {
 zeng.tab.init();
});
</script>
</head>
<body>
<div class="clearfix" id="hot">
  <div class="main_l tab">
    <div class="main_title clearfix">
      <ul class="fx">
        <li class="on"><a href="#">你是gril</a></li>
        <li class="">我是boy</li>
      </ul>
    </div>
    <div class="t">
      <div class="main_content clearfix">
      我在香格里拉
      </div>
    </div>
    <div class="t none">
      <div class="main_content clearfix">
    呵呵
      </div>
    </div>
  </div>
</div>
</body>
</html>

样式:

@charset "utf-8";
/* CSS Document */
#hot {
height: 565px;
overflow: hidden;
}
.clearfix {
display: block;
}
.clearfix::after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
ul {
    list-style: none outside none;
}
body {
    line-height: 1.5;
}
a, a:link, a:visited {
    color: #333333;
    text-decoration: none;
}
a:hover {
    color: #FF6600;
    text-decoration: none;
}
.main {
    padding: 0 10px 0 167px;
    position: relative;
    width: 823px;
}
.main_l {
    float: left;
    position: relative;
    width: 513px;
}
.main_r {
    float: right;
    position: relative;
    width: 300px;
}
.main_title {
    background: url("images/s.png") no-repeat scroll 0 0 transparent;
    float: left;
    height: 28px;
    overflow: hidden;
}
.main_title ul {
    font-size: 14px;
}
.main_title ul li {
    background: none repeat scroll 0 0 #F1F1F1;
    border-left: 1px solid #FFFFFF;
    border-right: 1px solid #FFFFFF;
    border-top: 3px solid #FFFFFF;
    float: left;
    height: 23px;
    line-height: 23px;
    padding-left: 16px;
    padding-right: 16px;
    padding-top: 1px;
}
.main_title ul .on {
    background: none repeat scroll 0 0 #FFFFFF;
    border-color: #009AD9 #009AD9 #FFFFFF;
    border-style: solid;
    border-width: 4px 1px 1px;
    height: 22px;
    line-height: 22px;
    padding-left: 16px;
    padding-right: 16px;
}
.main_title ul .on a {
    font-weight: 700;
}
.main_title span {
    float: right;
    line-height: 24px;
    padding-right: 10px;
    padding-top: 4px;
}
.main_l .main_title {
    overflow: hidden;
    width: 513px;
}
.main_l .main_content {
    width: 513px;
}
.tab div.t.none {
    display: none;
}
.tab .main_title ul.fx li, #link .main_l .main_title ul.fx li {
    background-color: transparent;
}
.tab .main_title ul.fx li, .tab .main_title ul.fx li.on {
    border-top: 0 none;
    margin-top: -8px;
    padding-top: 0;
}
.tab .main_title ul.fx li.on {
    border-bottom-width: 0;
    border-left-color: transparent;
    border-right-color: transparent;
}
.tab .main_title ul.fx {
    position: relative;
    z-index: 20;
}
.tab .main_title div.animate {
    background-color: #FFFFFF;
    border-color: #009AD9 #009AD9 #FFFFFF;
    border-style: solid;
    border-width: 4px 1px 1px;
    height: 23px;
    position: absolute;
    top: 0;
}

tab选项卡 源代码:

/*
 * tab 1.0
 * Date: 2011-07-09 15:29
 * http://zengxiangzhan.cnblogs.com/
 */
var zeng = zeng || {};
zeng.tab = {
    t: null,
    delayTime: 150,
    fx: true,
    tab: function(b) {
        $(b).siblings().removeClass("on");
        $(b).addClass("on");
        var c = $(b).parents(".tab").find("div.t");
        var a = c.eq($(b).index());
        c.addClass("none");
        a.removeClass("none");
        if (this.fx) {
            if ($(b).parent().hasClass("nofx")) {
                return
            }
            $(b).parent().siblings(".animate").width($(b).outerWidth() - 2).animate({
                left: $(b).position().left
            }, "slow")
        }
    },
    delayTab: function(b, a) {
        clearTimeout(b.t);
        this.t = setTimeout(function() {
            b.tab(a)
        }, this.delayTime)
    },
    init: function() {
        var a = this;
        a.animate();
        if (window.Touch) {
            $(".tab .main_title>ul>li[class!='on']>a").click(function() {
                return false
            })
        }
        $(".tab .main_title>ul>li,.tab>ul.hotread_menu>li").hover(function() {
            a.delayTab(a, this)
        }, function() {
            clearTimeout(a.t)
        })
    },
    animate: function() {
        if (!this.fx) {
            return
        }
        $(".tab .main_title>ul").each(function() {
            if (!$(this).hasClass("nofx")) {
                $(this).addClass("fx")
            }
        });
        $(".tab .main_title").each(function(a, b) {
            if ($(this).find("ul").hasClass("nofx")) {
                return
            }
            $(b).append("<div class='animate' ></div>");
            $(b).find(".animate").width($(b).find("ul>li.on").outerWidth() - 2).css("left", $(b).find("ul>li.on").position().left)
        })
    }
};

相关文章:

Linux上隐藏进程名(初级版)

缘起 上一篇博文 模仿nginx修改进程名 中提到了一种修改进程名的方法&#xff0c;就像 nginx 一样&#xff0c;给不同进程命名为 master 以及 worker 等。那么能不能把新进程名设置为空字符串呢&#xff1f;如果能&#xff0c;又会有哪些应用场景呢&#xff1f; 答案可能是能…

神操作!一行Python代码搞定一款游戏?给力!

来源&#xff1a;pypl编程榜一直以来Python长期霸占编程语言排行榜前三位&#xff0c;其简洁&#xff0c;功能强大的特性使越来越多的小伙伴开始学习Python 。甚至K12的同学都开始学习Python 编程。新手入门的时候趣味性其实最重要的。那么一行Python 代码到底能玩出什么花样&a…

jquery对所有input type=text的控件赋值

function resetData() { $("input[typetext]").each( function() { $(this).attr("value",""); } ); }

free not return memory

个人博客&#xff1a;https://rebootcat.com/2020/11/05/free_mem/ 内存泄露&#xff1f; 观察到一台机器上的内存使用量在程序启动之后&#xff0c;持续增长&#xff0c;中间没有出现内存恢复。怀疑是不是出现了内存泄露的问题&#xff1f; 然后使用相关的内存分析工具进行了…

成大事必备9种能力

挑战生存的能力&#xff1a;善于在现实中寻找答案 1、摆正心态&#xff0c;敢于面对现实 对于那些不停地抱怨现实恶劣的人来说&#xff0c;不能称心如意的现实&#xff0c;就如同生活的牢笼&a…

懂语言者得天下:NLP凭什么被称为人工智能的掌上明珠?

受访者 | 简仁贤&#xff0c;竹间智能创始人&CEO记者 | 邓晓娟出品 | AI科技大本营&#xff08;ID:rgznai100&#xff09;随着技术的发展&#xff0c;大数据、云计算、人工智能、区块链都慢慢地为人熟知。2016 年 Google 推出 AlphaGo&#xff0c;让人工智能走进了大众的视…

[转]SIFT特征提取分析

SIFT&#xff08;Scale-invariant feature transform&#xff09;是一种检测局部特征的算法&#xff0c;该算法通过求一幅图中的特征点&#xff08;interest points,or corner points&#xff09;及其有关scale 和 orientation 的描述子得到特征并进行图像特征点匹配&#xff0…

博客大事记之迁移博客到香港主机

个人博客&#xff1a;https://rebootcat.com/2020/11/10/move_blog_hk/ 前言 之前其实已经写过一篇博文&#xff1a; 迁移博客到香港虚拟空间&#xff0c;那为什么又要写这篇博客呢&#xff1f; 上次其实是把我的博客迁移到一个香港的虚拟空间里&#xff0c;但是不到半年的时…

限时福利:腾讯高级专家手把手教你打造 OCR 神器!

OCR&#xff0c;英文全称即 optical characters recognition&#xff08;光学字符识别&#xff09;&#xff0c;通过服务器把图片上的文字识别出来&#xff0c;以供大家编辑使用&#xff0c;比如进出火车站的时候&#xff0c;已经可以自动识别的身份证&#xff1b;在道路行驶中…

C++与.net的编译方式

C和.Net程序采用了两种不同的编译方式。 通常一个C编写的程序&#xff0c;都是一次编译成二进制的代码&#xff0c;在相应的操作系统平台上直接执行即可。 而.Net程序采用两次编译的方式&#xff0c;用C#&#xff0c;VB.Net等语言写成的程序被编译成IL代码&#xff0c;通过CLR在…

awk (一)

示例文件&#xff1a;[rootorclsrv ~]# catsample Heigh-ho! sing,heigh-ho! unto the green holly: Most friendship isfeigning, most loving mere folly: Then, heigh-ho, theholly!使用感叹号(!) 作为字段分隔符(FS)打印示例数据的第1 个字段&#xff1a;[rootorclsrv~]# …

TCP全连接和半连接的问题探讨

个人博客&#xff1a; https://rebootcat.com/2020/11/14/tcp_accept/ 从何说起 说起 tcp 的连接过程&#xff0c;想必 “3次握手4次挥手”是大家广为熟知的知识&#xff0c;那么关于更细节更底层的连接过程也许就很少人能讲清楚了。 所以本文会先简单回顾一下 tcp 的 3次握手…

[转] ASP.NET MVC3 路由和多数据集的返回

1.ASP.NET MVC3 中的路由 同前边一样本篇并不会过多的介绍理论知识&#xff0c;我们在Global.asax.cs文件中可以看到如下代码&#xff1a; routes.MapRoute("Default", // Route name"{controller}/{action}/{id}", // URL with parametersnew { controlle…

给Python代码加上酷炫进度条的几种姿势

作者 | 刘早起来源 | 早起Python&#xff08;ID: zaoqi-python&#xff09;大家好&#xff0c;在下载某些文件的时候你一定会不时盯着进度条&#xff0c;在写代码的时候使用进度条可以便捷的观察任务处理情况&#xff0c;除了使用print来打印之外&#xff0c;今天本文就介绍几种…

(转)mongodb分片

本文转载自&#xff1a;http://www.cnblogs.com/huangxincheng/archive/2012/03/07/2383284.html 在mongodb里面存在另一种集群&#xff0c;就是分片技术&#xff0c;跟sql server的表分区类似&#xff0c;我们知道当数据量达到T级别的时候&#xff0c;我们的磁盘&#xff0c;内…

深入浅出paxos

原文 https://rebootcat.com/2020/12/05/paxos/

Uber 前无人驾驶工程师告诉你,国内无人驾驶之路还要走多久?

受访者 | Graviti 创始人&CEO 崔运凯记者 | Aholiab&#xff0c;编辑 | Carol出品 | AI科技大本营&#xff08;ID:rgznai100&#xff09;经过数年的发展&#xff0c;现在的人们谈到“AI”已经不再像过去一般感到遥不可及。但 AI 在国内发挥的作用仍然只是冰山一角&#xff…

oracle服务

OracleOraDb11g_home1ClrAgent服务&#xff0c;在网上查找到了资料 http://download.oracle.com/docs/cd/B19306_01/win.102/b14306/install.htm Configuring Extproc Agent Using Windows Service As part of Oracle Database Extensions for .NET installation, a Windows se…

B00009 C语言分割字符串库函数strtok

切割字符串是常用的处理。 这里给出一个使用函数strtok切割字符串的例子。 使用C语言的库函数strtok来切割字符串的好处在于&#xff0c;可以指定任意字符作为分隔符来切割单词。使用该函数&#xff0c;切割字符串的分隔符可以同时指定多个&#xff0c;放在一个字符串数组中。 …

WEB打印大全

1、控制"纵打"、 横打”和“页面的边距。 &#xff08;1&#xff09;<script defer> function SetPrintSettings() { // -- advanced features factory.printing.SetMarginMeasure(2) // measure margins in inches factory.SetPageRange(false, 1, 3) // ne…

漫画 | 程序媛小姐姐带你一次了解什么是排序算法

来源 | 小齐本齐封图 | CSDN 付费下载自视觉中国插入排序借用《算法导论》里的例子&#xff0c;就是我们打牌的时候&#xff0c;每新拿一张牌都会把它按顺序插入&#xff0c;这&#xff0c;其实就是插入排序。齐姐声明&#xff1a;虽然我们用打牌的例子&#xff0c;但是可不能学…

POJ 1207 The 3n + 1 problem

题目链接&#xff1a;http://poj.org/problem?id1207 题目大意&#xff1a;给你一个数x&#xff0c;规定一个函数F(x)&#xff0c;如果x为1则F(x)1&#xff0c;否则如果x是偶数&#xff0c;F(x)F(x/2)&#xff0c;x为奇数F(x)F(3*x1)计算给定x到变换到1的步数。 注意点&#x…

PopupWindow响应返回键的问题

假设情景是这样的&#xff1a;在一个Activity中弹出一个PopupWindow&#xff0c;要求在按返回键时关闭该PopupWindow。 如果该PopupWindow是无焦点的&#xff08;默认情况&#xff09;&#xff0c;那么可以在Activity中响应返回键&#xff08;onBackPressed&#xff09;&#x…

Unix / Linux世界里的4-2-1

Unix / Linux世界里的4-2-1 在Unix / Linux世界里&#xff0c;4代表可读( r )&#xff0c;2代表可写入 ( w )&#xff0c;1代表可执行 ( x ) 如果拥有7 421 的权限&#xff0c;即代表这个人可以对档案完全控制。 以0777为例&#xff1a; 去掉0&#xff0c;第一个7代表着拥有者…

深度学习概述:NLP vs CNN

作者 | Manish Kuwar译者 | 苏本如&#xff0c;责编 | 郭芮头图 | CSDN 下载自视觉中国出品 | CSDN&#xff08;ID&#xff1a;CSDNnews&#xff09;以下为译文&#xff1a;当今&#xff0c;人工智能已经不仅仅是一个技术术语了。这项技术在过去十年的时间内几乎将其影响扩展到…

oracle 求A中不存在于B的记录

oracle 求A中不存在于B的记录 select * from a minus select * from b 是求A中不存在于B的记录select * from a union select * from b 是求A和B的DISTINCT的并集select * from a union all select * from b 是求A和B的冗余并集那么A和B的交集是什么函数来的?交集是 INTERSE…

正则表达式grep、egrep--already

第一式 grep是什么 #man grepgrep&#xff08;global search regular expression&#xff08;RE&#xff09;是一种强大的文本搜索工具&#xff0c;它能使用正则表达式搜索文本&#xff0c;并把匹配的行打印出来。UNIX的grep家族包括grep、egrep和fgrep。egrep和fgrep的命令…

万字长文综述目标检测领域,你要的都在这里

来源 | AI专栏&#xff08;ID: pursue-Y-future&#xff09;目标检测是计算机视觉中的一个重要问题&#xff0c;近年来传统检测方法已难以满足人们对目标检测效果的要求&#xff0c;随着深度学习在图像分类任务上取得巨大进展&#xff0c;基于深度学习的目标检测算法逐渐成为主…

ASP.net随机数应用实例

家可能都用过Chinaren的校友录&#xff0c;不久前它的留言簿上加了一个防止灌水的方法&#xff0c;就是系统每次产生一个由随机的数字和字母组成的图片&#xff0c;每次留言必须正确地输入这些随机产生的字符&#xff0c;否则不能添加留言。这是一个很好的防止恶意攻击的方法&a…

PreferenceActivity是什么?

我们看到Android系统本身就大量用到了PreferenceActivity来对系统进行信息配置和管理&#xff0c;那么它是怎么保存数据的呢&#xff0c;如何创建PrefenceActivity的呢?创建Android项目&#xff0c;并添加一个pref.xml文件(先建一个xml名的Folder)。注意&#xff0c;这次选择的…