»
EnglishFrenchVietnamese

Print - Animated Tooltip for Links - JavaScriptBank.com

Full version: jsB@nk » Status » Status » Animated Tooltip for Links
URL: http://www.javascriptbank.com/animated-tooltip-for-links.html

Animated Tooltip for Links © JavaScriptBank.comEverytime move mouse over links, this JavaScript animates the tooltip of JavaScript link to view in IE 4+ and NS 6. All other browsers will simply see the text in its original static state.

Full version: jsB@nk » Status » Status » Animated Tooltip for Links
URL: http://www.javascriptbank.com/animated-tooltip-for-links.html



JavaScript
<script>var data="0123456789";//set to 1 if not decrypting, set to 0 if decryptingvar done=1;function statusIn(text){decrypt(text,20,1);}function statusOut(){self.status='';done=1;}//-------------------------\\//decrypt(string, int, int)\\//-------------------------\\////text(string): the text to be decrypted on //the status bar.////max(int): the number of times a random string//is displayed before the next character is//'decrypted'.////delay(int): the number of milliseconds between//each display of a random string////Example://decrypt('Enter my site.',10,10);////text = 'Enter my site.' :: 'Enter my site.' is //eventually decrypted////max = 10 :: a different random string is dis-//played 10 times before a new character is//decryptedfunction 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 status = text.substring(0,charvar);for(var current_char = charvar; current_char < text.length; current_char++){status += data.charAt(Math.round(Math.random()*data.length));}window.status = status;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><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<a href="www.javascriptbank.com" onmouseover="statusIn('Bank of over 2000+ free JavaScript');return true" onmouseout="statusOut();">Mouse over here then see your status bar</a><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->