tab标签 插件 by 腾讯 jianminlu
2024-08-26 02:21:38
/**
* @version 0.1
* @author jianminlu
* @update 2013-06-19 15:23
*/
(function ($) {
/**
* @name tabs 页卡函数
* @param {Object} 初始值
* @type {Object} 返回对象本身
*/
$.fn.tabs = function (options) {
var config = {
index: 0,
current:"current",
type: "mouseover",
hdItem: ".tab_hd_item",
bdItem: ".tab_bd_item"
},
obj = $(this),
opts = $.extend({}, config, options); $(opts.hdItem, obj).bind(opts.type, function(){
if(opts.index != $(opts.hdItem, obj).index($(this))){
opts.index = $(opts.hdItem, obj).index($(this));
setCurrent();
}
}); function setCurrent(){
$(opts.hdItem, obj).removeClass(opts.current).eq(opts.index).addClass(opts.current);
$(opts.bdItem, obj).css({"display":"none"}).eq(opts.index).css({"display":"block"});
//$(opts.bdItem, obj).removeClass(opts.current).eq(opts.index).addClass(opts.current);
}
setCurrent();
return obj;
};
})(jQuery);/* |xGv00|dfe9081c71f0cee5596e5d50fdf18e87 */ 用法:
<div id="tabs1" class="tabs tabs1">
<ul class="tab_hd cf">
<li class="tab_hd_item current">关于腾讯精品课</li>
<li class="tab_hd_item">如何查找课程</li>
<li class="tab_hd_item">订阅课程</li>
<li class="tab_hd_item">创建课程指南</li>
<li class="tab_hd_item">常见问题Q&A</li>
<li class="tab_hd_item">联系我们</li>
</ul>
</div>
<script type="text/javascript" src="http://joke.qq.com/lucky/jquery.tabs.js"></script>
<script type="text/javascript">
// tabs调用
$(function () {
$("#tabs1").tabs({
index: 0,
type: "mouseover",
current: "current",
hdItem: ".tab_hd_item",
bdItem: ".tab_bd_item"
});
});
</script>
http://joke.qq.com/lucky/jquery.tabs.js
最新文章
- WebSocket简单介绍
- node.js 快速体验
- yii phpexcel <;转>;
- vim 删除临时文件
- OpenGL于MFC使用汇总(三)——离屏渲染
- Android 插件化方案(动态加载)总结
- 2018-2019-2 网络对抗技术 20165225 Exp4 恶意代码分析
- win7有多条隧道适配器(isatap、teredo、6to4)的原因及关闭方法
- android bionic c 对比 gnu c
- 微信小程序之 ----API接口
- [Windows Azure] Load Balancing Virtual Machines
- 怎么运行cocos2dx 3.x simulator?
- SpringMVC 之 Hello World 入门
- js-template-art【四】通过helper方法注册,调用外部方法
- (10)场景转换(Transitions)
- jQuery--基本介绍与下载
- SpringMVC_HelloWorld_03
- exchange邮箱系统增加验证码机制
- idea自动生成spring实体
- 第七篇:使用 fcntl 函数 获取,设置文件的状态标志
热门文章
- centos7 install k8s centos 安装 kubernetes 详细
- 【BZOJ3653】谈笑风生 离线+树状数组+DFS序
- MYSQL常用命令(转载)
- 初级Java面试题 &ndash; SSM框架篇
- find-if-an-item-is-in-a-javascript-array
- python - while语句/pass/死循环/break/continue/while...else...
- python - 安装/解释器/变量
- Linux之Redis-redis哨兵集群详解
- C#版-Redis缓存服务器在Windows下的使用
- 014-HQL中级4-Hive中的三种不同的数据导出方式介绍