{"id":148096,"student_id":10,"content":"{\"html\":\"\u003c!DOCTYPE html\u003e\\n\u003chtml\u003e\\n\u003chead\u003e\\n\\t\u003ctitle\u003eDocument\u003c/title\u003e\\n\\t\u003cscript src=\\\"https://code.jquery.com/jquery-3.3.1.min.js\\\"\u003e\u003c/script\u003e\\n\u003c/head\u003e\\n\u003cbody\u003e\\n \u003cdiv class=\\\"container\\\"\u003e\\n \u003cdiv class=\\\"card\\\"\u003e1\u003c/div\u003e\\n \u003cdiv class=\\\"card\\\"\u003e2\u003c/div\u003e\\n \u003cdiv class=\\\"card\\\"\u003e3\u003c/div\u003e\\n \u003cdiv class=\\\"card\\\"\u003e4\u003c/div\u003e\\n \u003cdiv class=\\\"card\\\"\u003e5\u003c/div\u003e\\n \u003cdiv class=\\\"card\\\"\u003e6\u003c/div\u003e\\n \u003cdiv class=\\\"card\\\"\u003e7\u003c/div\u003e\\n \u003cdiv class=\\\"card\\\"\u003e8\u003c/div\u003e\\n \u003cdiv class=\\\"card\\\"\u003e9\u003c/div\u003e\\n \u003cdiv class=\\\"card\\\"\u003e10\u003c/div\u003e\\n \u003cdiv class=\\\"card\\\"\u003e11\u003c/div\u003e\\n \u003cdiv class=\\\"card\\\"\u003e12\u003c/div\u003e\\n \u003cdiv class=\\\"card\\\"\u003e13\u003c/div\u003e\\n \u003cdiv class=\\\"card\\\"\u003e14\u003c/div\u003e\\n \u003cdiv class=\\\"card\\\"\u003e15\u003c/div\u003e\\n \u003cdiv class=\\\"card\\\"\u003e16\u003c/div\u003e\\n \u003cdiv class=\\\"card\\\"\u003e17\u003c/div\u003e\\n \u003cdiv class=\\\"card\\\"\u003e18\u003c/div\u003e\\n \u003cdiv class=\\\"card\\\"\u003e19\u003c/div\u003e\\n \u003cdiv class=\\\"card\\\"\u003e20\u003c/div\u003e\\n \u003cdiv class=\\\"card\\\"\u003e21\u003c/div\u003e\\n \u003cdiv class=\\\"card\\\"\u003e22\u003c/div\u003e\\n \u003cdiv class=\\\"card\\\"\u003e23\u003c/div\u003e\\n \u003cdiv class=\\\"card\\\"\u003e24\u003c/div\u003e\\n \u003cdiv class=\\\"card\\\"\u003e25\u003c/div\u003e\\n \u003c/div\u003e\\n\u003c/body\u003e\\n\u003c/html\u003e\\n\\n\",\"css\":\".container {\\n text-align: center;\\n top: 50%;\\n left: 50%;\\n width: 400px;\\n height: 400px;\\n position: fixed;\\n transform: translate(-50%, -50%);\\n}\\n\\n.card {\\n font-size: 16px;\\n width: 70px;\\n height: 70px;\\n margin: 5px;\\n border-radius: 5px;\\n float: left;\\n line-height: 70px;\\n color: #fff;\\n background-color: royalblue;\\n cursor: pointer;\\n text-shadow: 0px 0px 5px gray;\\n box-shadow: 0px 0px 5px gray;\\n transition: 0.2s;\\n}\\n\\n.card:hover {\\n background-color: gold;\\n}\\n\\n\\n/* .hide {\\n visibility: hidden;\\n} */\\n\\n\\n\",\"js\":\"var startTime = Date.now();\\nvar count = 1;\\n\\n// 1 排堆放入陣列 與 取得牌1的文字\\nvar cards = $('.container div');\\nconsole.log($(cards[1]).text())\\n\\n// 2 取得點擊的卡片數值\\n$('.container div').on('click', check);\\nfunction check() {\\n var num = Number($(this).text());\\n console.log(num)\\n\\n // 3 增加卡片數值\\n if (count == num \u0026\u0026 num \u003c= 25) {\\n $(this).text(num + 25);\\n count++;\\n }\\n\\n // 4 隱藏卡片\\n if (count == num \u0026\u0026 num \u003e 25) {\\n // 作法 1\\n $(this).css('visibility', 'hidden');\\n // 作法 2\\n // $(this).addClass('hide');\\n count++;\\n }\\n\\n // 5 結束遊戲\\n if (count == 51) {\\n cards.text('');\\n cards.css('visibility', 'visible');\\n cards.css('backgroundColor', 'gold');\\n \\n // 6 顯示完賽時間\\n var time = (Date.now() - startTime)/1000;\\n $(cards[11]).text('結果');\\n $(cards[12]).text(time);\\n $(cards[13]).text('秒');\\n }\\n}\\n\\n// // 7 交換1、2格的內容\\n// var tmp1 = $(cards[0]).text();\\n// var tmp2 = $(cards[1]).text();\\n\\n// $(cards[0]).text(tmp1);\\n// $(cards[1]).text(tmp2);\\n\\n// 8 洗牌演算法\\nfor (var i=0; i\u003c50; i++) {\\n //隨機取兩格\\n var rand1 = Math.floor(Math.random()*25);\\n var rand2 = Math.floor(Math.random()*25);\\n //將隨機取到的兩個內容存到變數中\\n var tmp1 = $(cards[rand1]).text();\\n var tmp2 = $(cards[rand2]).text();\\n //將兩格的內容交換放入\\n $('').text(tmp1);\\n $(cards[rand2]).text(tmp2);\\n}\"}","created_at":"2020-05-12T13:08:39.877+08:00","updated_at":"2020-05-12T13:09:03.041+08:00","name":"11. 1 to 50 副本","language":"web","screenshot":{"url":null},"parent_id":59778,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":237,"hashid":"zpesvmn8","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":2563984,"file_name":"koding.png","project_id":148096,"asset_id":111968,"created_at":"2020-05-12T13:08:39.884+08:00","updated_at":"2020-05-12T13:08:39.884+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
前往網站頁面
1:1:1
1:1
full
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦