Heim  >  Artikel  >  Web-Frontend  >  解密效果_JavaScript

解密效果_JavaScript

WBOY
WBOYOriginal
2016-05-16 19:29:171133Durchsuche




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


Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:文本加密解密_JavaScriptNächster Artikel:动态加载iframe_JavaScript