jq的each方法有2種情況 對應(yīng)的參數(shù)是
1遍歷數(shù)組 .each(function(index,value){}) //參數(shù)是數(shù)組下標(biāo) 以及下標(biāo)對應(yīng)的值
2遍歷json對象 如這一節(jié)的 .each(dataInt.data,function(key,value){})
//參數(shù)是2個(gè) 第一個(gè)為Json數(shù)據(jù)需要遍歷的屬性 這里是data 即dataInt.data
第二個(gè)參數(shù)是函數(shù) 函數(shù)里的2個(gè)參數(shù)分別是每個(gè)鍵值對的下標(biāo)(若是0) 以及該下標(biāo)對應(yīng)的值 (值是{'src':''0.jpg})
1遍歷數(shù)組 .each(function(index,value){}) //參數(shù)是數(shù)組下標(biāo) 以及下標(biāo)對應(yīng)的值
2遍歷json對象 如這一節(jié)的 .each(dataInt.data,function(key,value){})
//參數(shù)是2個(gè) 第一個(gè)為Json數(shù)據(jù)需要遍歷的屬性 這里是data 即dataInt.data
第二個(gè)參數(shù)是函數(shù) 函數(shù)里的2個(gè)參數(shù)分別是每個(gè)鍵值對的下標(biāo)(若是0) 以及該下標(biāo)對應(yīng)的值 (值是{'src':''0.jpg})
2017-02-16
老師應(yīng)該做個(gè)自適應(yīng)的瀑布流
這種很蛋疼 不過自適應(yīng)也好實(shí)現(xiàn)
這種很蛋疼 不過自適應(yīng)也好實(shí)現(xiàn)
2017-02-15
當(dāng)最后模塊距離頂部的距離到達(dá)一個(gè)臨界值(滾動(dòng)條滾動(dòng)距離+可視窗口大?。┑臅r(shí)候開始輪播前面的圖片。
2017-02-13
取parent的id為‘main’下的class為box的元素可以使用var main = document.getElementById('main');
var box = main.getElementsByClassName('box');
var box = main.getElementsByClassName('box');
2017-02-10
parent.getElementsByClassName(className)
2017-02-04
拿jquery和zepto.js寫速度代碼量會(huì)更好吧,兼容性也還不錯(cuò)
2017-01-25