抽奖程序取得返回值 本帖最后由 qymdf4 于 2010-07-24 17:28:24 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <script> var theTimer; var iNum=0; function checkLoad() { iNum=selectFrom(0,9); document.getElementById("stext").innerHTML=iNum; theTimer = setTimeout("checkLoad()", 8); } function selectFrom(iFirstValue,iLastValue){ var iChoices = iLastValue-iFirstValue+1; return Math.floor(Math.random()*iChoices+iFirstValue); } function stopPlay(iNum) { clearTimeout(theTimer);} function getDia() { alert(document.getElementById("stext").innerHTML)} </script> <body> <table width="100%"> <tr height="300"> <td align="center"> <div id="stext" style="font-size:146px;color:red;bold" align="center">0</div> </td> </tr> <tr height=""><td> <div align="center"> <input type="button" value="开始" onClick="checkLoad(),setTimeout('stopPlay()',1000)" style="height:60;width:130"/> <input type="button" value="获取" onClick="getDia()" style="height:60;width:130"/> </div> </td> </tr> </table> <script> var theTimer; var iNum=0; function checkLoad() { iNum=selectFrom(0,9); document.getElementById("stext").innerHTML=iNum; theTimer = setTimeout("checkLoad()", 8); } function selectFrom(iFirstValue,iLastValue){ var iChoices = iLastValue-iFirstValue+1; return Math.floor(Math.random()*iChoices+iFirstValue); } function stopPlay(iNum) { clearTimeout(theTimer); alert("抽奖结果为:"+document.getElementById("stext").innerHTML);} </script> <body> <table width="100%"> <tr height="300"> <td align="center"> <div id="stext" style="font-size:146px;color:red;bold" align="center">0</div> </td> </tr> <tr height=""><td> <div align="center"> <input type="button" value="开始" onClick="checkLoad(),setTimeout('stopPlay()',1000)" style="height:60;width:130"/> </div> </td> </tr> </table> ext 中 如何缩短label与field之间的距离 extjs html ProgressBar 很恐怖,很严重的内存问题,高手啊高手 IE6下 jQuery+ajax+thickbox 出现的问题。【求解决】 如何固定IE窗口? 表格隐藏显现列控制 关于 onclick 与 onmousemove 事件 这个效果如何实现啊?帮帮忙! js if嵌套优化问题 jquery左侧导航二级打开之后又自动收起 关于window.onscroll 浮动div 一个奇怪的问题(在ie正常,在傲游不正常) 大家讨论一下megavideo.com的JS
<script>
var theTimer;
var iNum=0;
function checkLoad() {
iNum=selectFrom(0,9);
document.getElementById("stext").innerHTML=iNum;
theTimer = setTimeout("checkLoad()", 8);
}
function selectFrom(iFirstValue,iLastValue){
var iChoices = iLastValue-iFirstValue+1;
return Math.floor(Math.random()*iChoices+iFirstValue);
}
function stopPlay(iNum) {
clearTimeout(theTimer);
}
function getDia() {
alert(document.getElementById("stext").innerHTML)
}
</script>
<body>
<table width="100%">
<tr height="300">
<td align="center">
<div id="stext" style="font-size:146px;color:red;bold" align="center">0</div>
</td>
</tr>
<tr height=""><td>
<div align="center">
<input type="button" value="开始" onClick="checkLoad(),setTimeout('stopPlay()',1000)" style="height:60;width:130"/>
<input type="button" value="获取" onClick="getDia()" style="height:60;width:130"/>
</div>
</td>
</tr> </table>
<script>
var theTimer;
var iNum=0;
function checkLoad() {
iNum=selectFrom(0,9);
document.getElementById("stext").innerHTML=iNum;
theTimer = setTimeout("checkLoad()", 8);
}
function selectFrom(iFirstValue,iLastValue){
var iChoices = iLastValue-iFirstValue+1;
return Math.floor(Math.random()*iChoices+iFirstValue);
}
function stopPlay(iNum) {
clearTimeout(theTimer);
alert("抽奖结果为:"+document.getElementById("stext").innerHTML);
}
</script>
<body>
<table width="100%">
<tr height="300">
<td align="center">
<div id="stext" style="font-size:146px;color:red;bold" align="center">0</div>
</td>
</tr>
<tr height=""><td>
<div align="center">
<input type="button" value="开始" onClick="checkLoad(),setTimeout('stopPlay()',1000)" style="height:60;width:130"/>
</div>
</td>
</tr> </table>