87,910
社区成员
发帖
与我相关
我的任务
分享
$.extend({
weibo:function(){
// var mm = new aa(opt.type);
$.extend(this,{
ff:function(){
alert('777');
},
plugin:{}
}); /// ********
/* function aa(){
this.create = function(){
alert('11111');
}
}*/
}
});
$.extend({a:1,b:2},{a:2,c:1}); // => {a: 2, b: 2, c:1}
带一个参数时,$.extend({a:1}) <=> $.extend($,{a:1}); 等价于扩展jQuery本身。[/quote]
不好意思啊 在求教一下大神
1.js是这样的
$.extend({
weibo:function(){
var mm = new aa();
$.extend(this,{
ff:function(){
mm.create();
},
plugin:{}
});
function aa(){
this.create = function(){
alert('99999');
}
}
}
});
2.js是这样的
jQuery.extend(weibo().plugin, {
image:function(element, options){
}
});
jQuery.extend(weibo().plugin.image, {
ee:function(){
alert('ccccc');
}
})
我怎么访问到ee这个函数呢 plugin:{
a:"a"
}
$.weibo();
//注册属性,事件
alert($.plugin.a);
$.extend({a:1,b:2},{a:2,c:1}); // => {a: 2, b: 2, c:1}
带一个参数时,$.extend({a:1}) <=> $.extend($,{a:1}); 等价于扩展jQuery本身。
new $.weibo().ff();
$.weibo();
//接下来ff就挂到jQuery下了已经
$.ff(); //alert("77")