词语搭配游戏的制作(ASP)三
词语搭配游戏的制作(ASP)三,词语搭配游戏的制作(ASP)三
//产生“点亮”的效果
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' onmouseover='lightOpt(this);' onmouseout='delightOpt(this);' ondblclick='removeOpt(this);' wrdIdx='" + iWrdIdx + "'>";
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="