/**
* @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

最新文章

  1. WebSocket简单介绍
  2. node.js 快速体验
  3. yii phpexcel &lt;转&gt;
  4. vim 删除临时文件
  5. OpenGL于MFC使用汇总(三)——离屏渲染
  6. Android 插件化方案(动态加载)总结
  7. 2018-2019-2 网络对抗技术 20165225 Exp4 恶意代码分析
  8. win7有多条隧道适配器(isatap、teredo、6to4)的原因及关闭方法
  9. android bionic c 对比 gnu c
  10. 微信小程序之 ----API接口
  11. [Windows Azure] Load Balancing Virtual Machines
  12. 怎么运行cocos2dx 3.x simulator?
  13. SpringMVC 之 Hello World 入门
  14. js-template-art【四】通过helper方法注册,调用外部方法
  15. (10)场景转换(Transitions)
  16. jQuery--基本介绍与下载
  17. SpringMVC_HelloWorld_03
  18. exchange邮箱系统增加验证码机制
  19. idea自动生成spring实体
  20. 第七篇:使用 fcntl 函数 获取,设置文件的状态标志

热门文章

  1. centos7 install k8s centos 安装 kubernetes 详细
  2. 【BZOJ3653】谈笑风生 离线+树状数组+DFS序
  3. MYSQL常用命令(转载)
  4. 初级Java面试题 &ndash; SSM框架篇
  5. find-if-an-item-is-in-a-javascript-array
  6. python - while语句/pass/死循环/break/continue/while...else...
  7. python - 安装/解释器/变量
  8. Linux之Redis-redis哨兵集群详解
  9. C#版-Redis缓存服务器在Windows下的使用
  10. 014-HQL中级4-Hive中的三种不同的数据导出方式介绍