首頁 > web前端 > js教程 > 主體

解密效果_JavaScript

WBOY
發布: 2016-05-16 19:29:17
原創
1138 人瀏覽過




<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>鼠标移到超链接上,
对链接的说明内容像解密
一样,由一连串的数字慢慢转变为字符.
 


相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
最新問題
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板