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

ASP
asp实现取得数组中的最大值的代码
asp 将日期格式化为需要的格式
asp 下产生任意位数随机密码的代码
asp下返回以千分位显示数字格式化的数值
asp重定向页面的方法总结
asp下去除数组中重复的项的方法
asp下实现 重新排序数字数组的代码
asp 验证输入网址是否有效并可以访问 与正则验证输入网址
asp验证Ip格式的函数
asp实现生成由数字,大写字母,小写字母指定位数的随机数
asp 格式化sql中的like字符串
asp 实现显示所有的服务器变量值的函数
asp 取得用户真实IP,对代理地址仍然有效的函数
asp 通用数据库连接过程函数
asp 字符串截取函数
asp下实现格式化文件大小以MB显示的函数
asp 下用正则表达式检测邮箱格式的函数
asp 实现检测字符串是否为纯字母和数字组合的函数
asp代码实现检测组件是否安装的函数
asp通过JMAIL实现通用发送函数

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 236 ::
收藏到网摘: 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="