jQuery.inArray( value, array ,[ fromIndex ] )
原型還是 indexOf 和 in 運(yùn)算符
原型還是 indexOf 和 in 運(yùn)算符
2017-08-16
其實(shí)還有一個(gè)參數(shù) jQuery.each(array, callback,args ) 不過args is for internal usage only ,仔細(xì)閱讀源碼 發(fā)現(xiàn) each 是 for 和for in 的寫法 鴨式辯型 做了兩個(gè)判斷 如果是數(shù)組 否則是對象 也是就是 只能傳入數(shù)組和對象 ,但是針對數(shù)組 也沒有使用ES5的 forEach 遍歷 可能是考慮兼容
2017-08-16
$.each($,function(index, value){
console.log(index, value)
})
源碼都出來了.
console.log(index, value)
})
源碼都出來了.
2017-08-14
each 在jQuery DOM篇講過
只不過這種寫法 $('div').each(function(){}) 相當(dāng)于$.each($('div'), function(){})
只不過這種寫法 $('div').each(function(){}) 相當(dāng)于$.each($('div'), function(){})
2017-08-14
$("#aaron a:eq(1)").css("color","green");
2017-08-14
為什么停止后再點(diǎn)擊執(zhí)行動(dòng)畫,它不會(huì)立即執(zhí)行,要過好久才執(zhí)行,有時(shí)候要點(diǎn)好幾下它才會(huì)執(zhí)行
2017-08-14
至于想知道那兩個(gè)函數(shù)的對象有什么屬性和方法 可以console.log()出來
我實(shí)驗(yàn)過了:
step的:
T…n.init {elem: div#aaron, prop: "height", easing: "swing", options: Object, now: 50…}
easing
:
"swing"
elem
:
div#aaron
end
:
50
now
:
50
options
:
Object
pos
:
1
prop
:
"height"
start
:
100
unit
:
"px"
__proto__
:
O
我實(shí)驗(yàn)過了:
step的:
T…n.init {elem: div#aaron, prop: "height", easing: "swing", options: Object, now: 50…}
easing
:
"swing"
elem
:
div#aaron
end
:
50
now
:
50
options
:
Object
pos
:
1
prop
:
"height"
start
:
100
unit
:
"px"
__proto__
:
O
2017-08-14
step:function(){}
參數(shù)1:就是progress的參數(shù)2
參數(shù)2:一個(gè)對象,包含了與css相關(guān)的東西,我也不知道怎么用.好像這個(gè)對象有一個(gè) 字段(屬性或者說變量)叫elem 這個(gè)elem是執(zhí)行該動(dòng)畫的元素
可以輸出到控制臺(tái)看看:
step: function(now, fx) {
console.log(fx.elem)
}
參數(shù)1:就是progress的參數(shù)2
參數(shù)2:一個(gè)對象,包含了與css相關(guān)的東西,我也不知道怎么用.好像這個(gè)對象有一個(gè) 字段(屬性或者說變量)叫elem 這個(gè)elem是執(zhí)行該動(dòng)畫的元素
可以輸出到控制臺(tái)看看:
step: function(now, fx) {
console.log(fx.elem)
}
2017-08-14
progress:function(){}
參數(shù)1:是一個(gè)對象,包含對象進(jìn)度相關(guān)的屬性,至于怎么用我也不知道
參數(shù)2: 動(dòng)畫修改的css屬性的當(dāng)前這一步的值(步之間的時(shí)間間隔系統(tǒng)覺定,他想怎樣為一步就怎樣)
參數(shù)3:當(dāng)前這一步執(zhí)行到的進(jìn)度 從duration的初值到0
參數(shù)1:是一個(gè)對象,包含對象進(jìn)度相關(guān)的屬性,至于怎么用我也不知道
參數(shù)2: 動(dòng)畫修改的css屬性的當(dāng)前這一步的值(步之間的時(shí)間間隔系統(tǒng)覺定,他想怎樣為一步就怎樣)
參數(shù)3:當(dāng)前這一步執(zhí)行到的進(jìn)度 從duration的初值到0
2017-08-14