js中,var a=b,c,;(function($){$.fn.contentTabs = function(o){// default optionsvar options = $.extend({activeClass:'active',addToParent:true,autoHeight:false,autoRotate:false,animSpeed:400,switchTime:3000,effect:'none',// "fade","slide"tabLinks:'a',e
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/27 20:04:35
js中,var a=b,c,;(function($){$.fn.contentTabs = function(o){// default optionsvar options = $.extend({activeClass:'active',addToParent:true,autoHeight:false,autoRotate:false,animSpeed:400,switchTime:3000,effect:'none',// "fade","slide"tabLinks:'a',e
js中,var a=b,c,
;(function($){
$.fn.contentTabs = function(o){
// default options
var options = $.extend({
activeClass:'active',
addToParent:true,
autoHeight:false,
autoRotate:false,
animSpeed:400,
switchTime:3000,
effect:'none',// "fade","slide"
tabLinks:'a',
event:'click'
},o);
return this.each(function(){
var tabset = $(this);
var tabLinks = tabset.find(options.tabLinks);
var tabLinksParents = tabLinks.parent();
var prevActiveLink = tabLinks.eq(0),currentTab,animating;
var tabHolder;
.省略.
-------------------
上面代码是一个JQuery插件前面一部分的代码
看倒数第二句
var prevActiveLink = tabLinks.eq(0),currentTab,animating;
...声明一个变量,后面给了3个值?用逗号隔开.
没学过这种写法...
求指教.
js中,var a=b,c,;(function($){$.fn.contentTabs = function(o){// default optionsvar options = $.extend({activeClass:'active',addToParent:true,autoHeight:false,autoRotate:false,animSpeed:400,switchTime:3000,effect:'none',// "fade","slide"tabLinks:'a',e
var prevActiveLink = tabLinks.eq(0), currentTab, animating;
同时定义三个变量 prevActiveLink、currentTab和animating.
并且已经给 prevActiveLink赋值为tabLinks.eq(0).
这是var同时定义多个变量的方法.用逗号间隔.
通常把同一类型的变量同时定义