this.length=1
this[0]=elem
this.get=function(){
}
this[0]=elem
this.get=function(){
}
2017-07-23
1.將window.$保存在_$變量,這時(shí)window.$有兩種情況,一、可能是undefined,二、在jq之前使用$的某個(gè)類庫
2.jq初始化,將jQuery賦值給window.$
3.調(diào)用noConflict 方法,將之前保存的_$賦值給window.$
2.jq初始化,將jQuery賦值給window.$
3.調(diào)用noConflict 方法,將之前保存的_$賦值給window.$
2017-07-21
靜態(tài):$.each();
實(shí)例方法:$("img").each
其中$.each()是jquery.fn.each()方法;jquery.prototyp=jquery.fn;
$("img").each; 先通過jquery.fn.init()返回一個(gè)jquery的對象,jQuery.fn.init.prototype = ajQuery.fn;再調(diào)用each方法
實(shí)例方法:$("img").each
其中$.each()是jquery.fn.each()方法;jquery.prototyp=jquery.fn;
$("img").each; 先通過jquery.fn.init()返回一個(gè)jquery的對象,jQuery.fn.init.prototype = ajQuery.fn;再調(diào)用each方法
2017-06-30
后面改成這樣就和$.each 這樣的方法一樣了
ajQuery.setName = function(myName) {
this.myName = myName
return this;
}
ajQuery.getName = function() {
$("#aaron").html(this.myName)
return this;
}
$$.setName('慕課網(wǎng)-Aaron').getName();
ajQuery.setName = function(myName) {
this.myName = myName
return this;
}
ajQuery.getName = function() {
$("#aaron").html(this.myName)
return this;
}
$$.setName('慕課網(wǎng)-Aaron').getName();
2017-06-14