新手求指教2句jquery代码含义
$.fn.dynamictab = function(settings){
settings = jQuery.extend({
navid : '#nav',
navtag : 'li',
navclass : 'on',
ev : 'click',
index : 0,
callback : null
}, settings || {});
return this.each(function(){
var container = this;
var navList = $(settings.navid).find(settings.navtag),
cur = settings.index,
cls = settings.navclass,
ev = settings.ev,
callback = settings.callback;
$(navList[cur]).addClass(cls);
navList.each(function(i){
$(this).bind(settings.ev, function(event){
$(navList).removeClass(cls);
$(this).addClass(cls);
event.preventDefault();
if(settings.callback){
callback(this);
}
});
});
});
};
我就想问两句:
1.$.fn.dynamictab = function(settings){
2 settings = jQuery.extend({
navid : '#nav',
navtag : 'li',
navclass : 'on',
ev : 'click',
index : 0,
callback : null
}, settings || {});
分别什么意思,最好能告诉我这么编写模式的含义
------解决方案--------------------