资料
表格
制度
合同
管理
职场
经营
创业
范文
总结
计划
作文
文章
美文
词句
教程
模板
图片
字体
图标
办公
人事
财务
生产
管理资源吧首页
>>>
教程
>>>
编程
>>>
JavaScript教程
>>>
javascript 扫雷游戏
<img src="/_New/_cj/myeditor/sysimage/space.gif" class="ewebeditor__script" _ewebeditor_fake_tag="script" _ewebeditor_fake_value="%3Cscript%20type%3D%22text%2Fjavascript%22%3E%3C!--%20%0D%0Afunction%20StringBuffer()%20%7B%20%0D%0Athis._strings%20%3D%20new%20Array()%3B%20%0D%0A%7D%20%0D%0AStringBuffer.prototype.append%20%3D%20function(str)%20%7B%20%0D%0Athis._strings.push(str)%3B%20%0D%0A%7D%20%0D%0AStringBuffer.prototype.toString%20%3D%20function()%20%7B%20%0D%0Areturn%20this._strings.join(%22%22)%3B%20%0D%0A%7D%20%0D%0A%0D%0Avar%20rownum%3B%20%2F%2Frow%20number%20%0D%0Avar%20colnum%3B%20%2F%2Fcolumn%20number%20%0D%0Avar%20minenum%3B%20%2F%2Fmine%20number%20%0D%0Avar%20totalCellNum%3B%20%2F%2F%20total%20number%20of%20cell%20%0D%0Avar%20elapseTime%3B%20%2F%2Felapse%20time%20for%20mine%20sweeping%20%0D%0Avar%20statedNum%3B%20%2F%2F%20swept%20cell%20number%20%0D%0Avar%20elapseSpan%3B%20%2F%2F%20for%20display%20elapse%20time%20%0D%0Avar%20tick%3B%20%2F%2F%20timer%20for%20mine%20sweeping%20%0D%0A%0D%0A%2F%2Fgenerating%20mine%20area%20%0D%0Afunction%20init()%20%7B%20%0D%0Arownum%20%3D%20parseInt(document.mineform.rownum.value)%3B%20%0D%0Acolnum%20%3D%20parseInt(document.mineform.colnum.value)%3B%20%0D%0Aminenum%20%3D%20parseInt(document.mineform.minenum.value)%3B%20%0D%0AtotalCellNum%20%3D%20rownum%20*%20colnum%3B%20%0D%0A%0D%0Avar%20buffer%20%3D%20new%20StringBuffer()%3B%20%0D%0Abuffer.append(%22%3Ctable%20cellspacing%3D%5C%220%5C%22%20cellpadding%3D%5C%220%5C%22%20border%3D'1'%3E%22)%3B%20%0D%0Afor%20(var%20i%20%3D%200%3B%20i%20%3C%20rownum%3B%20i%2B%2B)%20%7B%20%0D%0Abuffer.append(%22%3Ctr%3E%22)%3B%20%0D%0Afor(var%20j%20%3D%200%3B%20j%20%3C%20colnum%3B%20j%2B%2B)%20%0D%0Abuffer.append(%22%3Ctd%20bgcolor%3D'%23AAA898'%20id%3D%5C%22%22%20%2B%20i%20%2B%20%22_%22%20%2B%20j%2B%22%5C%22%20name%3D'cell'%20%2F%3E%26nbsp%3B%3C%2Ftd%3E%22)%3B%20%0D%0Abuffer.append(%22%3C%2Ftr%3E%22)%3B%20%0D%0A%7D%20%0D%0Abuffer.append(%22%3C%2Ftable%3E%22)%3B%20%0D%0Avar%20workarea%20%3D%20document.getElementById(%22workarea%22)%3B%20%0D%0Aworkarea.innerHTML%20%3D%20buffer.toString()%3B%20%0D%0Amine()%3B%20%2F%2F%20lay%20mines%20at%20the%20work%20area%20%0D%0AstartTick()%3B%20%2F%2F%20starting%20time%20%0D%0A%7D%20%0D%0A%0D%0A%2F%2F%20periodically%20update%20the%20elapsed%20time%20%0D%0Afunction%20displayelapsedTime()%20%7B%20%0D%0AelapseSpan.innerHTML%20%3D%20elapseTime%2B%2B%3B%20%0D%0Aif%20(elapseTime%20%3E%20999)%20%0D%0AstopTick()%3B%20%0D%0A%7D%20%0D%0A%0D%0A%2F%2F%20start%20up%20the%20timer%20for%20sweeping%20mine%20%0D%0Afunction%20startTick()%20%7B%20%0D%0Aif%20(tick)%20stopTick()%3B%20%0D%0AelapseTime%20%3D%200%3B%20%0D%0AstatedNum%20%3D%200%3B%20%0D%0AelapseSpan%20%3D%20document.getElementById(%22elapse%22)%3B%20%0D%0Adocument.getElementById(%22message%22).innerHTML%20%3D%20%22%22%3B%20%0D%0Atick%20%3D%20setInterval(displayelapsedTime%2C%201000)%3B%20%2F%2F%20start%20tick%20%0D%0A%7D%20%0D%0A%0D%0A%2F%2F%20stop%20the%20timer%20%0D%0Afunction%20stopTick()%20%7B%20%0D%0AclearInterval(tick)%3B%20%0D%0Atick%20%3D%20null%3B%20%0D%0A%7D%20%0D%0A%0D%0A%2F%2F%20lay%20mines%20at%20the%20work%20area%20%0D%0Afunction%20mine()%20%7B%20%0D%0Avar%20arr%20%3D%20new%20Array(totalCellNum)%3B%20%0D%0A%0D%0Afor(var%20i%20%3D%200%3B%20i%20%3C%20totalCellNum%3B%20i%2B%2B)%20%0D%0Aarr%5Bi%5D%20%3D%20i%3B%20%0D%0A%0D%0Afor(var%20i%20%3D%200%3B%20i%20%3C%20minenum%3B%20i%2B%2B)%20%7B%20%0D%0Avar%20suffix%20%3D%20Math.floor(arr.length%20*%20Math.random())%3B%20%0D%0Avar%20rnd%20%3D%20arr%5Bsuffix%5D%3B%20%0D%0Avar%20row%20%3D%20Math.floor(rnd%20%2F%20colnum)%3B%20%0D%0Avar%20col%20%3D%20rnd%20%25%20colnum%3B%20%0D%0Avar%20cell%20%3D%20document.getElementById(row%20%2B%20%22_%22%20%2B%20col)%3B%20%0D%0Acell.mine%20%3D%20%22%E2%97%8F%22%3B%20%0D%0Aarr.splice(suffix%2C%201)%3B%20%0D%0A%7D%20%0D%0AcalcMineForAll()%3B%20%0D%0A%7D%20%0D%0A%0D%0A%2F%2F%20calculating%20mine%20number%20for%20each%20cell%20%0D%0Afunction%20calcMineForAll()%20%7B%20%0D%0Afor(var%20i%20%3D%200%3B%20i%20%3C%20rownum%3B%20i%2B%2B)%20%7B%20%0D%0Afor(var%20j%20%3D%200%3B%20j%20%3C%20colnum%3B%20j%2B%2B)%20%7B%20%0D%0AcalcMine(i%2C%20j)%3B%20%0D%0A%7D%20%0D%0A%7D%20%0D%0A%7D%20%0D%0A%0D%0A%2F%2F%20calculating%20mine%20number%20for%20given%20cell%20%0D%0Afunction%20calcMine(row%2C%20col)%20%7B%20%0D%0Avar%20cell%20%3D%20document.getElementById(row%20%2B%20%22_%22%20%2B%20col)%3B%20%0D%0Avar%20nums%20%3D%200%3B%20%0D%0A%0D%0Aif(row%20%3E%200)%20%7B%20%0D%0Aif(col%20%3E%200)%20%7B%20%0D%0Aif(document.getElementById((row%20-%201)%20%2B%20%22_%22%20%2B%20(col%20-%201)).mine)%20%2F%2Ftop%20left%20%0D%0Anums%2B%2B%3B%20%0D%0A%7D%20%0D%0Aif(col%20%3C%20colnum%20-%201)%20%7B%20%0D%0Aif(document.getElementById((row%20-%201)%20%2B%20%22_%22%20%2B%20(col%20%2B%201)).mine)%20%2F%2Ftop%20right%20%0D%0Anums%2B%2B%3B%20%0D%0A%7D%20%0D%0Aif(document.getElementById((row%20-%201)%20%2B%20%22_%22%20%2B%20col).mine)%20%2F%2F%20top%20%0D%0Anums%2B%2B%3B%20%0D%0A%7D%20%0D%0Aif(row%20%3C%20rownum%20-%201)%20%7B%20%0D%0Aif(col%20%3E%200)%20%7B%20%0D%0Aif(document.getElementById((row%20%2B%201)%20%2B%20%22_%22%20%2B%20(col%20-%201)).mine)%20%2F%2Fbottom%20left%20%0D%0Anums%2B%2B%3B%20%0D%0A%7D%20%0D%0Aif(col%20%3C%20colnum%20-%201)%20%7B%20%0D%0Aif(document.getElementById((row%20%2B%201)%20%2B%20%22_%22%20%2B%20(col%20%2B%201)).mine)%20%2F%2Fbottom%20right%20%0D%0Anums%2B%2B%3B%20%0D%0A%7D%20%0D%0Aif(document.getElementById((row%20%2B%201)%20%2B%20%22_%22%20%2B%20col).mine)%20%2F%2F%20bottom%20%0D%0Anums%2B%2B%3B%20%0D%0A%7D%20%0D%0Aif(col%20%3E%200)%20%0D%0Aif(document.getElementById(row%20%2B%20%22_%22%20%2B%20(col%20-%201)).mine)%20%2F%2Fleft%20%0D%0Anums%2B%2B%3B%20%0D%0Aif(col%20%3C%20colnum%20-%201)%20%0D%0Aif(document.getElementById(row%20%2B%20%22_%22%20%2B%20(col%20%2B%201)).mine)%20%2F%2Fright%20%0D%0Anums%2B%2B%3B%20%0D%0A%2F%2Fif(typeof(cell.mine)%20%3D%3D%20%22undefined%22)%20%0D%0Acell.nums%20%3D%20nums%3B%20%0D%0A%7D%20%0D%0A%0D%0A%2F%2F%20count%20number%20of%20marked%20cell%20around%20given%20coordinate%20%0D%0Afunction%20countMarkNum(row%2C%20col)%20%7B%20%0D%0Avar%20nums%20%3D%200%3B%20%0D%0Aif(row%20%3E%200)%20%7B%20%0D%0Aif(col%20%3E%200)%20%7B%20%0D%0Aif(document.getElementById((row%20-%201)%20%2B%20%22_%22%20%2B%20(col%20-%201)).state%20%3D%3D%20%22mark%22)%20%2F%2Ftop%20left%20%0D%0Anums%2B%2B%3B%20%0D%0A%7D%20%0D%0Aif(col%20%3C%20colnum%20-%201)%20%7B%20%0D%0Aif(document.getElementById((row%20-%201)%20%2B%20%22_%22%20%2B%20(col%20%2B%201)).state%20%3D%3D%20%22mark%22)%20%2F%2Ftop%20right%20%0D%0Anums%2B%2B%3B%20%0D%0A%7D%20%0D%0Aif(document.getElementById((row%20-%201)%20%2B%20%22_%22%20%2B%20col).state%20%3D%3D%20%22mark%22)%20%2F%2F%20top%20%0D%0Anums%2B%2B%3B%20%0D%0A%7D%20%0D%0Aif(row%20%3C%20rownum%20-1)%20%7B%20%0D%0Aif(col%20%3E%200)%20%7B%20%0D%0Aif(document.getElementById((row%20%2B%201)%20%2B%20%22_%22%20%2B%20(col%20-%201)).state%20%3D%3D%20%22mark%22)%20%2F%2Fbottom%20left%20%0D%0Anums%2B%2B%3B%20%0D%0A%7D%20%0D%0Aif(col%20%3C%20colnum%20-%201)%20%7B%20%0D%0Aif(document.getElementById((row%20%2B%201)%20%2B%20%22_%22%20%2B%20(col%20%2B%201)).state%20%3D%3D%20%22mark%22)%20%2F%2Fbottom%20right%20%0D%0Anums%2B%2B%3B%20%0D%0A%7D%20%0D%0Aif(document.getElementById((row%20%2B%201)%20%2B%20%22_%22%20%2B%20col).state%20%3D%3D%20%22mark%22)%20%2F%2F%20bottom%20%0D%0Anums%2B%2B%3B%20%0D%0A%7D%20%0D%0Aif(col%20%3E%200)%20%0D%0Aif(document.getElementById(row%20%2B%20%22_%22%20%2B%20(col%20-%201)).state%20%3D%3D%20%22mark%22)%20%2F%2Fleft%20%0D%0Anums%2B%2B%3B%20%0D%0Aif(col%20%3C%20colnum%20-%201)%20%0D%0Aif(document.getElementById(row%20%2B%20%22_%22%20%2B%20(col%20%2B%201)).state%20%3D%3D%20%22mark%22)%20%2F%2Fright%20%0D%0Anums%2B%2B%3B%20%0D%0Areturn%20nums%3B%20%0D%0A%7D%20%0D%0A%0D%0A%2F%2F%20click%20the%20cell%20%0D%0Afunction%20clickMe(cell)%20%7B%20%0D%0Aif(typeof(cell.state)%20%3D%3D%20%22undefined%22)%20%7B%20%0D%0Aif%20(cell.mine%20%3D%3D%20%22%E2%97%8F%22)%20%7B%20%2F%2F%20if%20incaution%20touch%20the%20mine%2C%20game%20immediate%20over%20%0D%0Agameover(cell)%3B%20%0D%0Areturn%3B%20%0D%0A%7D%20%0D%0Aif%20(cell.nums%20%3E%200)%20%7B%20%0D%0Acell.state%20%3D%20%22up%22%3B%20%0D%0AstatedNum%2B%2B%3B%20%0D%0Acell.className%20%3D%20%22up%22%3B%20%0D%0Acell.innerHTML%20%3D%20getColoredNum(cell.nums)%3B%20%0D%0A%0D%0A%7D%20else%20%7B%20%0D%0Avar%20a%20%3D%20cell.id.split(%22_%22)%3B%20%0D%0Avar%20row%20%3D%20parseInt(a%5B0%5D)%3B%20%0D%0Avar%20col%20%3D%20parseInt(a%5B1%5D)%3B%20%0D%0Adisclose(row%2C%20col)%3B%20%0D%0A%7D%20%0D%0AisWin()%3B%20%0D%0A%7D%20%0D%0A%7D%20%0D%0A%0D%0A%2F%2F%20touch%20the%20mine%2C%20game%20over%20%0D%0Afunction%20gameover(element)%20%7B%20%0D%0Afor(var%20i%20%3D%200%3B%20i%20%3C%20rownum%3B%20i%2B%2B)%20%7B%20%0D%0Afor(var%20j%20%3D%200%3B%20j%20%3C%20colnum%3B%20j%2B%2B)%20%7B%20%0D%0Avar%20cell%20%3D%20document.getElementById(i%20%2B%20%22_%22%20%2B%20j)%3B%20%0D%0Aif%20(cell.state%20%3D%3D%20%22up%22)%20continue%3B%20%0D%0Aif%20(cell.mine)%20%7B%20%0D%0Aif%20(typeof(cell.state)%20%3D%3D%20%22undefined%22)%20%7B%20%0D%0Acell.innerHTML%20%3D%20%22%E2%97%8F%22%3B%20%0D%0Acell.style.cssText%20%3D%20%22font-family%3A%E5%AE%8B%E4%BD%93%22%3B%20%0D%0A%7D%20%0D%0A%7D%20%0D%0A%7D%20%0D%0A%7D%20%0D%0Aelement.state%20%3D%20%22up%22%3B%20%0D%0Aelement.innerHTML%20%3D%20%22%E2%97%8F%22%3B%20%0D%0Aelement.style.cssText%20%3D%20%22color%3A%23AA0000%3Bfont-family%3A%E5%AE%8B%E4%BD%93%3Bfont-size%3A14px%22%3B%20%0D%0AstopTick()%3B%20%0D%0Adocument.getElementById(%22message%22).innerHTML%20%3D%20%22%3Cfont%20color%3D'%23DD0000'%3ESorry%2C%20you%20lost%20the%20game!%3C%2Ffont%3E%22%3B%20%0D%0A%7D%20%0D%0A%0D%0A%2F%2F%20get%20colored%20number%2C%20difference%20number%20will%20be%20colored%20difference%20color%20%0D%0Afunction%20getColoredNum(nums)%20%7B%20%0D%0Avar%20color%3B%20%0D%0Aswitch(nums)%20%7B%20%0D%0Acase%201%3A%20color%20%3D%20%22%230000EE%22%3B%20break%3B%20%0D%0Acase%202%3A%20color%20%3D%20%22%2300AA00%22%3B%20break%3B%20%0D%0Acase%203%3A%20color%20%3D%20%22%23990000%22%3B%20break%3B%20%0D%0Acase%204%3A%20color%20%3D%20%22%23FF0000%22%3B%20break%3B%20%0D%0Acase%205%3A%20color%20%3D%20%22%23550000%22%3B%20break%3B%20%0D%0Acase%206%3A%20color%20%3D%20%22%23550055%22%3B%20break%3B%20%0D%0Acase%207%3A%20color%20%3D%20%22%23223366%22%3B%20break%3B%20%0D%0Adefault%3A%20color%20%3D%20%22%23000000%22%3B%20%0D%0A%7D%20%0D%0Areturn%20%22%3Cfont%20color%3D%22%20%2B%20color%20%2B%20%22%3E%22%20%2B%20nums%20%2B%20%22%3C%2Ffont%3E%22%3B%20%0D%0A%7D%20%0D%0A%0D%0A%0D%0Afunction%20disclose(row%2C%20col)%20%7B%20%0D%0Avar%20cell%20%3D%20document.getElementById(row%20%2B%20%22_%22%20%2B%20col)%3B%20%0D%0Aif(cell%20%26%26%20typeof(cell.mine)%20%3D%3D%20%22undefined%22%20%26%26%20typeof(cell.state)%20%3D%3D%20%22undefined%22)%20%7B%20%0D%0Acell.state%20%3D%20%22up%22%3B%20%0D%0Acell.className%20%3D%20%22up%22%3B%20%0D%0AstatedNum%2B%2B%3B%20%0D%0Aif%20(cell.nums%20%3D%3D%200)%20%7B%20%0D%0Aif(row%20%3E%200)%20%7B%20%0D%0Adisclose(row%20-%201%2C%20col)%3B%20%0D%0Aif(col%20%3E%200)%20%2F%2F%20top%20left%20%0D%0Adisclose(row%20-%201%2C%20col%20-%201)%3B%20%0D%0Aif(col%20%3C%20colnum%20-1)%20%2F%2F%20top%20right%20%0D%0Adisclose(row%20-%201%2C%20col%20%2B%201)%3B%20%0D%0A%7D%20%0D%0Aif(row%20%3C%20rownum%20-%201)%20%7B%20%0D%0Adisclose(row%20%2B%201%2C%20col)%3B%20%0D%0Aif(col%20%3E%200)%20%2F%2F%20bottom%20left%20%0D%0Adisclose(row%20%2B%201%2C%20col%20-%201)%3B%20%0D%0Aif(col%20%3C%20colnum%20-1)%20%2F%2F%20bottom%20right%20%0D%0Adisclose(row%20%2B%201%2C%20col%20%2B%201)%3B%20%0D%0A%7D%20%0D%0Aif(col%20%3E%200)%20%0D%0Adisclose(row%2C%20col%20-%201)%3B%20%2F%2F%20left%20%0D%0Aif(col%20%3C%20colnum%20-1)%20%0D%0Adisclose(row%2C%20col%20%2B%201)%3B%20%2F%2F%20right%20%0D%0A%7D%20else%20%7B%20%0D%0Acell.innerHTML%20%3D%20getColoredNum(cell.nums)%3B%20%0D%0A%7D%20%0D%0A%7D%20%0D%0A%7D%20%0D%0A%0D%0A%2F%2F%20mark%20or%20unmark%20a%20cell%20%0D%0Afunction%20markMe(cell)%20%7B%20%0D%0Aif%20(cell.state%20%3D%3D%20%22mark%22)%20%7B%20%0D%0Acell.innerHTML%20%3D%20%22%26nbsp%3B%22%3B%20%0D%0Acell.state%20%3D%20undefined%3B%20%0D%0AstatedNum--%3B%20%0D%0A%7D%20else%20if%20(typeof(cell.state)%20%3D%3D%20%22undefined%22)%20%7B%20%0D%0Acell.innerHTML%20%3D%20%22F%22%3B%20%0D%0Acell.state%20%3D%20%22mark%22%3B%20%0D%0AstatedNum%2B%2B%3B%20%0D%0AisWin()%3B%20%0D%0A%7D%20%0D%0A%7D%20%0D%0A%0D%0A%2F%2F%20determine%20the%20game%20is%20win%20%0D%0Afunction%20isWin()%20%7B%20%0D%0Aif%20(statedNum%20%3D%3D%20totalCellNum)%20%7B%20%0D%0Adocument.getElementById(%22message%22).innerHTML%20%3D%20%22%3Cfont%20color%3D'%23008800'%3ECongratulations%2C%20you%20won%20the%20game!%3C%2Ffont%3E%22%3B%20%0D%0AstopTick()%3B%20%0D%0A%7D%20%0D%0A%7D%20%0D%0A%0D%0A%2F%2F%20when%20left%20and%20right%20key%20down%20%0D%0Afunction%20doubleClick(cell)%20%7B%20%0D%0Aif(typeof(cell.state)%20%3D%3D%20%22undefined%22)%20%7B%20%0D%0AclickMe(cell)%3B%20%0D%0Areturn%3B%20%0D%0A%7D%20%0D%0A%0D%0Avar%20a%20%3D%20cell.id.split(%22_%22)%3B%20%0D%0Avar%20row%20%3D%20parseInt(a%5B0%5D)%3B%20%0D%0Avar%20col%20%3D%20parseInt(a%5B1%5D)%3B%20%0D%0Aif%20(cell.innerHTML.indexOf(%22%3E%22%20%2B%20countMarkNum(row%2C%20col)%20%2B%20%22%3C%2F%22)%20%3E%20-1)%20%7B%20%0D%0Aif(row%20%3E%200)%20%7B%20%0D%0AclickMe(document.getElementById((row%20-%201)%20%2B%20%22_%22%20%2B%20col))%3B%20%0D%0Aif(col%20%3E%200)%20%2F%2F%20top%20left%20%0D%0AclickMe(document.getElementById((row%20-%201)%20%2B%20%22_%22%20%2B%20(col%20-%201)))%3B%20%0D%0Aif(col%20%3C%20colnum%20-1)%20%2F%2F%20top%20right%20%0D%0AclickMe(document.getElementById((row%20-%201)%20%2B%20%22_%22%20%2B%20(col%20%2B%201)))%3B%20%0D%0A%7D%20%0D%0Aif(row%20%3C%20rownum%20-%201)%20%7B%20%0D%0AclickMe(document.getElementById((row%20%2B%201)%20%2B%20%22_%22%20%2B%20col))%3B%20%0D%0Aif(col%20%3E%200)%20%2F%2F%20bottom%20left%20%0D%0AclickMe(document.getElementById((row%20%2B%201)%20%2B%20%22_%22%20%2B%20(col%20-%201)))%3B%20%0D%0Aif(col%20%3C%20colnum%20-1)%20%2F%2F%20bottom%20right%20%0D%0AclickMe(document.getElementById((row%20%2B%201)%20%2B%20%22_%22%20%2B%20(col%20%2B%201)))%3B%20%0D%0A%7D%20%0D%0Aif(col%20%3E%200)%20%0D%0AclickMe(document.getElementById(row%20%2B%20%22_%22%20%2B%20(col%20-%201)))%3B%20%2F%2F%20left%20%0D%0Aif(col%20%3C%20colnum%20-1)%20%0D%0AclickMe(document.getElementById(row%20%2B%20%22_%22%20%2B%20(col%20%2B%201)))%3B%20%2F%2F%20right%20%0D%0A%7D%20%0D%0A%7D%20%0D%0A%0D%0A%2F%2F%20process%20all%20mouse%20key%20down%20event%20%0D%0Adocument.onmousedown%20%3D%20function()%20%7B%20%0D%0Avar%20e%20%3D%20event%20%3F%20event%20%3A%20arguments%5B0%5D%20%3B%20%0D%0Avar%20cell%20%3D%20e.srcElement%20%3F%20e.srcElement%20%3A%20e.target%3B%20%0D%0Aif(cell.parentNode.name%20%3D%3D%20%22cell%22)%20%0D%0Acell%20%3D%20cell.parentNode%20%3B%20%0D%0A%0D%0Aif(cell.name%20%3D%3D%20%22cell%22)%20%7B%20%0D%0Aif%20(e.button%20%3D%3D%201)%20%2F%2Fleft%20click%20%0D%0AclickMe(cell)%3B%20%0D%0Aelse%20if%20(e.button%20%3D%3D%202)%20%2F%2Fright%20click%20%0D%0AmarkMe(cell)%3B%20%0D%0Aelse%20if%20(e.button%20%3D%3D%203)%20%2F%2Fleft%20and%20right%20click%20%0D%0AdoubleClick(cell)%3B%20%0D%0A%7D%20%0D%0Areturn%20true%3B%20%0D%0A%7D%20%0D%0A%2F%2F%20--%3E%3C%2Fscript%3E"> <style type="text/css"><!-- body { font-size:14px; font-family: verdana; } input { font-size:12px; padding: 0px; margin: 0px; } table {border: 2px solid #6E6560;} td { height:19px; width:20px; font-family: Arial Black; text-align: center; padding-top:3px; font-size: 12px; cursor:default; border-left: 2px solid #D5D3D0; border-top: 2px solid #D5D3D0; border-right: 2px solid #6E6560; border-bottom: 2px solid #6E6560; } .up { border-right: 2px solid #F6F3F0; border-bottom: 2px solid #F6F3F0; background:#F6F3F0; } --></style><style type="text/css" bogus="1">body { font-size:14px; font-family: verdana; } input { font-size:12px; padding: 0px; margin: 0px; } table {border: 2px solid #6E6560;} td { height:19px; width:20px; font-family: Arial Black; text-align: center; padding-top:3px; font-size: 12px; cursor:default; border-left: 2px solid #D5D3D0; border-top: 2px solid #D5D3D0; border-right: 2px solid #6E6560; border-bottom: 2px solid #6E6560; } .up { border-right: 2px solid #F6F3F0; border-bottom: 2px solid #F6F3F0; background:#F6F3F0; }</style> <html> <body oncontextmenu="return false" onselectstart="return false"> <div align="center"> <form name="mineform"> Row: <input type="text" name="rownum" size="5" value="15"/> Column: <input type="text" name="colnum" size="5" value="20"/> Mine Number: <input type="text" name="minenum" size="5" value="30"/> <input type="button" value=" Start " name="start" onclick="init()"/> Elapsed Time: <span id="elapse" style="width:30px;font-family:Arial Black" align="right"></span> </form> <p></p> <div id="workarea"></div> <p></p> <p></p> <div id="message" style="font-family:Arial Black;font-size:16px" style="font-family:Arial Black;font-size:16px"></div> </div> </body> </html>
[Ctrl+A 全选 注:
如需引入外部Js需刷新才能执行
]
教程首页
更多教程