tab标签 插件 by 腾讯 jianminlu
/**
* @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
tab标签 插件 by 腾讯 jianminlu的更多相关文章
- jquery插件之tab标签页或滑动门
该插件乃本博客作者所写,目的在于提升作者的js能力,也给一些js菜鸟在使用插件时提供一些便利,老鸟就悠然地飞过吧. 此插件旨在实现目前较为流行的tab标签页或滑动门特效,在此插件中默认使用的是鼠标滑过 ...
- Bootstrap插件——(Tab)标签页
项目中用到了Bootstrap的(Tab)标签页插件,记录如下: 代码如下: <div class="tabbable"> <ul class="nav ...
- 网站开发,推荐使用SuperSlide 插件-Tab标签切换,图片滚动,无缝滚动,焦点图
SuperSlide 致力于解决网站大部分特效展示问题,使网站代码规范整洁,方便维护更新.网站上常用的“焦点图/幻灯片”“Tab标签切换”“图片滚动”“无缝滚动”等只需要一个SuperSlide即可解 ...
- Bootstrap 标签页(Tab)插件
摘自: http://www.runoob.com/bootstrap/bootstrap-tab-plugin.html Bootstrap 标签页(Tab)插件 标签页(Tab)在 Bootstr ...
- Bootstrap-Plugin:标签页(Tab)插件
ylbtech-Bootstrap-Plugin:标签页(Tab)插件 1.返回顶部 1. Bootstrap 标签页(Tab)插件 标签页(Tab)在 Bootstrap 导航元素 一章中介绍过.通 ...
- 使用jQuery开发tab选项卡插件(可以右键关闭多个标签)
在前一篇“使用jQuery开发tab选项卡插件”的基础上添加了tab标签右键关闭菜单功能,菜单主要包括:关闭当前标签.关闭左侧标签.关闭右侧标签.关闭其他.关闭全部. 一.插件效果 二.实现思路 为w ...
- Source Insight 3.X 标签插件v1.0发布
Source Insight可以说是一款程序员必备的开发/阅读源码工具,美中不足的是SI没有标签栏,多个源码之间切换很不方便,于是我就乘闲暇之余写了该作品sihook:标签插件;不过严格意义上来说si ...
- 在Bootstrap开发中解决Tab标签页切换图表显示问题
在做响应式页面的时候,往往需要考虑更多尺寸设备的界面兼容性,一般不能写死像素,以便能够使得界面元素能够根据设备的不同进行动态调整,但往往有时候还是碰到一些问题,如Tab标签第一页面正常显示,但是切换其 ...
- jquery实现同时展示多个tab标签+左右箭头实现来回滚动(美化版增加删除按钮)
闲聊 前段时间小颖分享了:jquery实现同时展示多个tab标签+左右箭头实现来回滚动文章,引入项目后,我们的组长说样子太丑了,小颖觉得还好啊,要不大家评评理,看下丑不丑?无图无真相,来上图: 看吧其 ...
随机推荐
- Thymeleaf模板如何获取springMVC返回的model值
Thymeleaf模板如何获取springMVC返回的model值 后台的实现: @RequestMapping("/hello") public String hello(Mod ...
- [算法][LeetCode]Spiral Matrix——螺旋矩阵
题目要求 Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spir ...
- Ubuntu 中 apache 开启 rewrite 模块
ubuntu14.04中安装好apache2.4之后默认rewrite模块是不开启的,项目public目录下的.htaccess文件就用不了,在浏览器中访问网页总是报500错误,原因就是这个. 执行下 ...
- Code Forces 20A BerOS file system
A. BerOS file system time limit per test 2 seconds memory limit per test 64 megabytes input standard ...
- [iOS微博项目 - 4.3] - 设置每条微博边框样式
github: https://github.com/hellovoidworld/HVWWeibo A.设置每条微博边框样式 1.需求 不需要分割线 每个微博之间留有一定的间隙 2.思路 直接设 ...
- varints
Protocol Buffer技术详解(数据编码) - Stephen_Liu - 博客园 https://www.cnblogs.com/stephen-liu74/archive/2013/01/ ...
- cmd运行php
w D:\wamp64\bin\php\php7.0.4\php.exe 执行了 D:\wamp64\bin\php\php7.0.4\wtest.php
- ubuntu重新设置登陆界面|切换gdm kdm lightdm
方法: $ sudo dpkg-reconfigure gdm 然后会出一个让你进行选择的提示,根据需要切换即可
- Django系列
1.Django框架 2.Django restframework 其他 django之contenttype
- LeetCode_Symmetric Tree
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For e ...