Home  >  Article  >  Web Front-end  >  解密效果_JavaScript

解密效果_JavaScript

WBOY
WBOYOriginal
2016-05-16 19:29:171091browse




<script> <BR>var data = "0123456789"; <BR>var done = 1; <BR>function textboxin(text) { <BR>decrypt(text, 2, 1); <BR>} <br><br>function textboxout() { <BR>self.text.value = ''; <BR>done = 1; <BR>} <br><br>function decrypt(text, max, delay) //max=2 delay=1 <BR>{ <BR>if (done) { <BR>done = 0; <BR>decrypt_helper(text, max, delay, 0, max); <BR> } <BR>} <BR>function decrypt_helper(text, runs_left, delay, charvar, max) //处理解密效果 <BR>{ <BR>if (!done) { <BR>runs_left = runs_left - 1; // <BR>var box_text = text.substring(0, charvar); <BR>for (var current_char = charvar; current_char < text.length; current_char++) { <BR>box_text += data.charAt(Math.round(Math.random()*data.length)); //利用math对象的随机函数产生"密码"数字串 <BR>} <BR>window.text.value = box_text; <BR>//显示超链接的说明内容 <BR>var rerun = "decrypt_helper('" + text + "'," + runs_left + "," + delay + "," + charvar + "," + max + ");" <BR>var new_char = charvar + 1; <BR>var next_char = "decrypt_helper('" + text + "'," + max + "," + delay + "," + new_char + "," + max + ");" <BR>if(runs_left > 0) <BR> { <BR> setTimeout(rerun, delay); <BR> } <BR>else { <BR>if (charvar < text.length) { <BR>setTimeout(next_char, Math.round(delay*(charvar+3)/(charvar+1))); //设置"密码"和超链接说明内容的转换时间 <BR>} <BR>else { <BR>done = 1; <BR> } <BR> } <BR> } <BR>} <BR></script>





href="http://fishcat.blog.com.cn/cmd.shtml?do=blogs&id=58828&uid=39174" 
onmouseout=textboxout(); 
onmouseover="textboxin('http://fishcat.blog.com.cn 在这里你会看到许多的JavaScript特效。是不是像破解了密码?');return true;">JavaScript 
特效百例。









size=15>鼠标移到超链接上,
对链接的说明内容像解密
一样,由一连串的数字慢慢转变为字符.
 


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn