{"id":218561,"student_id":2589,"content":"{\"html\":\"\u003c!DOCTYPE html\u003e\\n\u003chtml\u003e\\n\u003chead\u003e\\n\\t\u003ctitle\u003eDocument\u003c/title\u003e\\n \u003cscript src=\\\"https://code.jquery.com/jquery-3.2.1.min.js\\\"\u003e\u003c/script\u003e\\n\u003c/head\u003e\\n\u003cbody\u003e\\n \u003ch1\u003eTic Tac Toe\u003c/h1\u003e\\n \u003cdiv class=\\\"grid\\\"\u003e\\n \u003cdiv id=\\\"a\\\"\u003e\u003c/div\u003e\\n \u003cdiv id=\\\"b\\\"\u003e\u003c/div\u003e\\n \u003cdiv id=\\\"c\\\"\u003e\u003c/div\u003e\\n \u003cdiv id=\\\"d\\\"\u003e\u003c/div\u003e\\n \u003cdiv id=\\\"e\\\"\u003e\u003c/div\u003e\\n \u003cdiv id=\\\"f\\\"\u003e\u003c/div\u003e\\n \u003cdiv id=\\\"g\\\"\u003e\u003c/div\u003e\\n \u003cdiv id=\\\"h\\\"\u003e\u003c/div\u003e\\n \u003cdiv id=\\\"i\\\"\u003e\u003c/div\u003e\\n \u003c/div\u003e\\n \u003cbutton\u003e再來一局!\u003c/button\u003e\\n\u003c/body\u003e\\n\u003c/html\u003e\",\"css\":\"/* 預設程式部分 */\\nbody {\\n text-align: center;\\n}\\n\\nh1 {\\n color: #dc685a; /* 給學生複製紅色色碼 */\\n}\\n\\nbutton {\\n padding: 10px;\\n border-width: 0px;\\n border-radius: 5px;\\n margin: 15px;\\n font-size: 16px;\\n color: #fff;\\n background-color: #ecaf4f; /* 給學生複製橘色色碼 */\\n}\\n\\n/* 以下學生要完成的部分 */\\n.grid {\\n width: 330px;\\n height: 330px;\\n margin: auto;\\n}\\n\\n.grid div {\\n width: 100px;\\n height: 100px;\\n border-radius: 10px;\\n margin: 5px;\\n float: left;\\n line-height: 100px;\\n font-size: 4rem;\\n font-weight: bold;\\n color: #ffffff;\\n background-color: #555555;\\n text-shadow: 0px 0px 10px #999;\\n box-shadow: 0px 0px 10px #999;\\n cursor: pointer;\\n transition: background-color 0.2s;\\n}\\n\\n.grid div:hover {\\n background-color: #333333;\\n}\",\"js\":\"\"}","created_at":"2021-01-13T15:55:45.893+08:00","updated_at":"2024-11-20T15:26:11.024+08:00","name":"井字遊戲(試玩版)","language":"web","screenshot":{"url":"https://cdn7.koding.school/uploads/project/screenshot/218561/32de5363d5cef5e29e4006d3a027fdf3.jpg"},"parent_id":3,"plugin":"var current = 'O';\n\n$('.grid div').click(function () {\n if ($(this).text() == '' \u0026\u0026 t != 'O獲勝' \u0026\u0026 t != 'X獲勝') {\n $(this).text(current);\n if (current == 'O') {\n current = 'X';\n $(this).css('background-color', '#ecaf4f'); // 橘色\n } else {\n current = 'O';\n $(this).css('background-color', '#dc685a'); // 紅色\n }\n }\n\n var a = $('#a').text();\n var b = $('#b').text();\n var c = $('#c').text();\n var d = $('#d').text();\n var e = $('#e').text();\n var f = $('#f').text();\n var g = $('#g').text();\n var h = $('#h').text();\n var i = $('#i').text();\n check(a, b, c);\n check(d, e, f);\n check(g, h, i);\n check(a, d, g);\n check(b, e, h);\n check(c, f, i);\n check(a, e, i);\n check(c, e, g);\n});\n\nfunction check(x, y, z) {\n if (x == y \u0026\u0026 y == z \u0026\u0026 x != '') {\n $('h1').text(x + '獲勝');\n }\n}\n\n$('button').click(function () {\n $('h1').text('Tic Tac Toe');\n $('.grid div').text('');\n $('.grid div').css('background-color', ''); // 為什麼不是設定 #555 ? 因為這樣 hover 的屬性就會失效!\n});","description":null,"note":null,"status":"public","like_student_ids":[18989,10764,7222,16412,8946,7403,11532,16424,17411,23147],"is_featured":false,"views":1056,"hashid":"5j3s93ppw","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
前往網站頁面
1:1:1
1:1
full
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦