当前位置: 首页 > 图文教程 > 网络编程 > ASP > 词语搭配游戏的制作(ASP)三

ASP
asp使用activex组件实例一
ASP中检查没有数据提交的页面Ⅰ
ASP中检查没有数据提交的页面Ⅱ
为ASP开发者介绍ColdFusion
W3 Jmail 简要介绍
W3 Jmail 参考说明
W3 Jmail 使用范例
ASP教程:堵住ASP漏洞
利 用 ASP 开 发 网 络 聊 天 室
MySQL数据库基础教程
ASP和SQLServer时间处理方法Ⅰ
如何利用ASP实现邮箱访问
SQL语言快速入门之一
SQL语言快速入门之二
SQL语言快速入门之三(一)
用纯ASP代码实现图片上传并存入数据库中
ASP进阶教程Ⅹ:留言簿自动发E-Mail
单元测试和事先测试开发(2)
.NET的事务控制.
.NET 的数据访问应用程序块(Data Access Application Block)

词语搭配游戏的制作(ASP)三


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 121 ::
收藏到网摘: n/a

  //在列表中,使鼠标移到之处的单词
//产生“点亮”的效果
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="