jQuery-tab切换
来源:互联网 发布:apache 进程过多 编辑:程序博客网 时间:2024/05/20 05:55
(function($){
// tab 切换
$.fn.tabSwitch = function(options){
var defaults = {
eventType : "click", //事件类型
on : "on", // 导航 style
tabNav : ".tab_nav>li",//导航
tableContent : ".tab_content>div" // 切换内容
}
var options = $.extend(defaults,options);
this.each(function(){
var _this = $(this);
_this.find(options.tabNav).on(options.eventType,function(){
$(this).addClass(options.on).siblings().removeClass(options.on);
var index = $(this).index();
_this.find(options.tableContent).eq(index).show().siblings().hide();
})
})
return this;
}
})(jQuery);
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="js/jquery-plugin.js" type="text/javascript"></script>
<script>
$(function(){
$(".tab").tabSwitch();
})
// 若大家想更改参数直接
$(".tab").tabSwitch({
on : "current"
});
</script>
<body>
<div class="tab" style="width:200px;">
<ul class="tab_nav" style="display: block; float: left;">
<li>html</li>
<li>css</li>
<li>js</li>
</ul>
<div class="tab_content" style="width:200px;" >
<div style="display:block;">html</div>
<div style="display:none;">css</div>
<div style="display:none;">js</div>
</div>
</div>
</body>
</html>
- jquery tab 切换DIV
- Jquery Tab框切换
- jquery tab切换
- jquery tab 切换
- jquery tab切换
- jquery 实现tab切换
- JQuery版tab切换
- jQuery Tab切换
- jQuery Tab栏切换
- tab切换-- jquery代码
- jQuery tab切换收集
- jQuery切换tab标签
- jquery实现tab切换
- JQUERY实现TAB切换
- jQuery-tab切换
- jquery div tab标签切换
- jQuery控制tab自动切换
- jQuery 实现Tab标签切换
- http://liwx2000.iteye.com/blog/1542431
- 坦克大战-BFS
- HttpClient帮助文档总结
- 关于mac键盘部分数字键和字母键失灵,无法使用的问题的解决方案
- 关于奋斗
- jQuery-tab切换
- Nexus搭建Maven私服
- MySql触发器
- JVM中的类加载器与双亲委派机制
- img撑满全屏的方法(img非背景图)
- 【Nature 特稿】机器学习算法重构威尼斯千年历史,成为“谷歌和 Facebook”
- mq读取
- 「Spark-2.2.0」Structured Streaming
- 何以解忧唯有追赶