jquery操作样式时什么时候都要加 "px"?引号什么时候用?请看带下划线的代码
if(board[i][j] == 0){
theNumberCell.css("width","0px");
theNumberCell.css("height","0px");
theNumberCell.css("top",getPosTop(i,j)+cellSideLength/2);
theNumberCell.css("left",getPosLeft(i,j)+cellSideLength/2);
}
else{
theNumberCell.css("width",cellSideLength);
theNumberCell.css("height",cellSideLength);
theNumberCell.css("top",getPosTop(i,j));
theNumberCell.css("left",getPosLeft(i,j));
theNumberCell.css("background-color",getNumberBackgroundColor(board[i][j]));
theNumberCell.css("color",getNumberColor(board[i][j]));
theNumberCell.text(getNumberText(board[i][j]));
}
hasConflicted[i][j] = false;
}
$(".number-cell").css("line-height",cellSideLength+"px");
$(".number-cell").css("font-size",0.6*cellSideLength+"px");