加载js文件失败了
Memory
Memory 2018-03-30 16:01:14
0
1
1425

var board = new Array();

$(document).ready() {

newgame();

}


function newgame() {

init();

generateOneNumber();

generateOneNumber();

}


##function init() {

alert("sdf");

for (var i = 0; i < 4 ; i++) {

borad[i] = new Array();

for (var j = 0; j < 4; j++) {

board[i ][j] = 0;


## var gridCell = $("#grid-cell-" + i + "-" + j);

gridCell.css("top", getPostTop(i, j));

gridCell.css("left", getPostLeft(i, j));

}

}

updateBoardview();

}

##function updateBoardview() {

for (var i = 0; i < 4; i++) {

## for (var j = 0; j < 4; j++) {


$("#grid-container").append("
< /div>");


var numberCell = $("#number-cell-" + i + "-" + j);

if (board[i][j]) {

## numberCell.css("宽度", 0 px);

numberCell.css("高度", 0 px);

numberCell.css("top", getPostTop(i, j) + 100);

numberCell.css("left", getPostLeft(i, j) + 100);

} else {

numberCell.css("宽度", 100 px);

numberCell.css("高度", 100 px);

numberCell.css(" top", getPostTop(i, j));

numberCell.css("left", getPostLeft(i, j));

numberCell.css("background-color", getNumberBackgroundColor (board[i][j]));

numberCell.css("color", getNumbercolor(board[i][j]));

numberCell.text(board[i] ][j]);

}

}

}

#}


#functiongenerateOneNumber() {

var randx = parseInt(Math.floor(Math.random() * 4));

var randy = parseInt(Math .floor(Math.random() * 4));

when(true) {

if (board[randx][randy] == 0) {

中断;

}

var randx = parseInt(Math.floor(Math.random() * 4));

var randy = parseInt(Math.floor(Math) .random() * 4));

}

var randNumber = Math.random() < 0.5? 2 : 4;

board[randx][randy] = randNumber;

showNumberWithAnimation(randx, randy, randNumber);

}

Memory
Memory

全部回复(1)
lge

f12看看报什么错,加载失败可能就是路径错了,检查一下路径看看

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!