The next two classes are empty to adjust the column width for the columns that may increase.
$ ("Div> p "). parent (). not ($ (". grid_2 ")). filter ("nth-child (" + lenth + "n + 1)") to select the 2nd columns of each row, but select the third column.
By using firbug to query this element, we have no intention to find that the nodeindex (nodeindex is in the same order as the element in the same level) under the element is the same as the value calculated by the parameter an + B, I used to directly use nodeindex to select 2nd columns, but I don't know how to do it.
I checked Baidu and found that nth-child is also using nodeindex. The specific implementation is as follows:
Copy codeThe Code is as follows:
Filters :{
// For example, $ ("input [name ^ = 'News']") [<inputname = "newsletter"/>]
ATTR: function (elem, match ){
Varresult = Expr. attrHandle [match [1]? Expr. attrHandle [match [1] (elem): elem [match [1] | elem. getAttribute (match [1]), value = result + "", type = match [2], check = match [4];
Returnresult = null?
Type = "! = ":
Type = "= "?
Value === check:
Type = "* = "?
Value. indexOf (check)> = 0:
Type = "~ = "?
("" + Value + ""). indexOf (check)> = 0:
! Match [4]?
Result:
Type = "! = "?
Value! = Check:
Type = "^ = "?
Value. indexOf (check) = 0:
Type = "$ = "?
Value. substr (value. length-check.length) === check:
Type = "| = "?
Value = check | value. substr (0, check. length + 1) = check + "-":
False;
}
}
Originally: nth-child (an + B) is based on Under the parent element of the element(That is, the child element will be selected from the parent element of your current element), instead of selecting the nth child element in the remaining element
Therefore, if I use. not to filter out the first column, the second column of nodeindex = 2 cannot be "the first column"