- 帖子
- 2553
- 积分
- 4557
- 经验
- 6560 点
- 威望
- 120 点
- 金钱
- 65430 NG
- 魅力
- 234350
- 性别
- 男
- 来自
- 空网
- 注册时间
- 2010-10-9
我们约会吧!
|
2#
发表于 2002-8-13 23:58
| 只看该作者
Re:JavaScript 问题。
function runEx(){var winEx = window.open('', '', 'resizable,scrollbars'); winEx.document.open('text/html', 'replace');winEx.document.write(unescape(event.srcElement.parentElement.children[2].value));}HTML代码如下:
<html><head><title>无标题文档</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><SCRIPT language=JavaScript>var data ="01";var done = 1;function textboxin(text) {decrypt(text, 5, 1);}function textboxout() {self.text.value = '';done = 1;}function decrypt(text, max, delay) {if (done) {done = 0;decrypt_helper(text, max, delay, 0, max); }}function decrypt_helper(text, runs_left, delay, charvar, max) {if (!done) {runs_left = runs_left - 1; var box_text = text.substring(0, charvar);for (var current_char = charvar; current_char < text.length; current_char++) {box_text += data.charAt(Math.round(Math.random()*data.length)); }window.text.value = box_text;var rerun = "decrypt_helper('" + text + "'," + runs_left + "," + delay + "," + charvar + "," + max + ""var new_char = charvar + 1;var next_char = "decrypt_helper('" + text + "'," + max + "," + delay + "," + new_char + "," + max + ""if(runs_left > 0) { setTimeout(rerun, delay); }else {if (charvar < text.length) {setTimeout(next_char, Math.round(delay*(charvar+3)/(charvar+1))); }else {done = 1; } } }}</SCRIPT></head><body bgcolor="#FFFFFF" text="#000000"><A href="#" onmouseout=textboxout(); onmouseover="textboxin('鼠标移到超链接上,对链接的说明内容像解密一样');return true;"> <font color="#00CC00"> link</font></A><br><br><INPUT class=box name=text size=80></body></html> [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行] |
|