您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

jquery tab插件精简版分享_jquery

2024/5/22 4:22:22发布31次查看
复制代码 代码如下:
/*
* jqpresstoos1.0
*
* copyright (c) 2011 yepeng
* dual licensed under the mit (mit-license.txt)
* and gpl (gpl-license.txt) licenses.
*
*/
$.fn.extend({
//插件名称:tab选项卡
jqpresstab: function(options) {
//参数和默认值
var defaults = {
_tabclass: null,//选项卡样式
_childs:null //子选项 样式选择器
};
var options = $.extend(defaults, options);
var o = options;
var parentcate = $(this);
var childcate = $(o._childs);
parentcate.mouseover(function() {
parentcate.removeclass(o._tabclass);
$(this).addclass(o._tabclass);
for (i = 0; i if (parentcate[i].classname == o._tabclass) {
childcate[i].style.display = block;
} else {
childcate[i].style.display = none;
}
}
});
}
});
})(jquery);
调用方法更简单:
复制代码 代码如下:
jquery(document).ready(function(){ $(.mytab li a).jqpresstab({ _tabclass: 样式名称, _childs: 子元素样式名称 });});
如果需要根据id做选择器自己扩展去吧,呵呵
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product