詞語搭配遊戲的製作(ASP)三

來源:互聯網
上載者:User
//在列表中,使滑鼠移到之處的單詞
//產生“點亮”的效果
function lightOpt(ele)
{
var eleSrc;
//------------------------------------------
//常變數說明
//eleSrc :發生事件的元素
//------------------------------------------

eleSrc = ele;
eleSrc.className = "optLighted";
}

//在列表中,使滑鼠離開的單詞
//還原為初始狀態
function delightOpt(ele)
{
var eleSrc;
//------------------------------------------
//常變數說明
//eleSrc :發生事件的元素
//------------------------------------------

eleSrc = ele;
eleSrc.className = "optDelighted";
}

//得到定義過的將加入列表的單詞
function makeOpt(strWord, iWrdIdx)
{
var strOptHead, strOptFoot;
var strOptWord;

//------------------------------------------
//常變數說明
//strOptHead :重定義單詞頭。字串型
//strOptFoot :重定義單詞尾。字串型
//strOptWord :重定義單詞。字串型
//------------------------------------------

strOptHead = "<div class='optDelighted' >";
strOptFoot = "</div>";
strOptWord = strOptHead + strWord + strOptFoot;
//alert(strOptWord);

return strOptWord;
}

//刪除列表中的單詞
function removeOpt(ele)
{
var eleSrc;
var iIndex, iWrdIdx;
var astrWords, astrHead, astrFoot;

//------------------------------------------
//常變數說明
//eleSrc :發生事件的元素
//iIndex :表示詞彙分類的數字。整型
//iWrdIdx :單詞在單詞數組中的索引。整型
//astrWords :某類詞彙單詞數組。字串型數組
//astrHead :某類詞彙單詞數組頭部分。字串型數組
//astrFoot :某類詞彙單詞數組尾部分。字串型數組
//------------------------------------------

eleSrc = ele;
iIndex = getEleIndex(eleSrc.parentElement);
iWrdIdx = parseInt(eleSrc.wrdIdx);

//將單詞從詞彙數組中刪去
//showArray(m_astrWords[iIndex]);
astrWords = m_astrWords[iIndex].concat();
astrHead = astrWords.slice(0, iWrdIdx);
astrFoot = astrWords.slice(iWrdIdx + 1);
m_astrWords[iIndex] = astrHead.concat(astrFoot);
//showArray(astrHead);
//showArray(astrFoot);
//showArray(m_astrWords[iIndex]);

//將剩餘的單詞重新寫入到頁面中
valueList(m_astrWords[iIndex], iIndex);
txtWord[iIndex].select();
}
//-->
</script>
</head>

<body>
<!--標題-->
<div align="CENTER">
<span style="font-size: 20pt; font-weight: BOLD">詞語搭配遊戲</span>
<span class="fontEng2">v1.0</span>
</div>

<hr style="visibility: HIDDEN">
<!--主表格1-->
<table border="0" align="CENTER" width="80%">

<colgroup></colgroup>
<colgroup></colgroup>
<colgroup></colgroup>
<colgroup></colgroup>
<colgroup></colgroup>
<colgroup></colgroup>
<colgroup align="CENTER"></colgroup>
<colgroup></colgroup>

<%For m_iCount = 0 To (m_iPartCnt - 1)%>
<tr>
<td><%= m_astrSenPart(m_iCount)%></td>
<td width="20%"><input type="text" id="txtWord" style="width: 100%"></td>
<td><button id="btnGetWord" style="width: 75px" title="將單詞儲存到記憶體中">儲存</button></td>
<td><button id="btnReset" style="width: 75px" title="從記憶體中刪去當前類別所有的單詞">重設</button></td>
<td><button id="btnSave" style="width: 75px" title="將單詞儲存到檔案中">存入</button></td>
<td><button id="btnLoad" style="width: 75px" title="從檔案中載入單詞">載入</button></td>
<td width="15%"><label id="lblWordList" title="單擊固定我">單字清單</label></td>
<td>
<div id="divWordList" class="listHidden"></div>
個數:<label id="lblWordCount" class="fontEng1"><%= 0%></label>
</td>
</tr>
<%Next%>

</table>

<hr style="visibility: HIDDEN">
<hr style="color: BLUE">
<!--主表格2-->
<table border="0" align="CENTER" width="80%">
<colgroup width="16%"></colgroup>
<colgroup width=&qu



相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.