»
EnglishFrenchVietnamese

Print - Nudging text - JavaScriptBank.com

Full version: jsB@nk » Text » Animation » Nudging text
URL: https://www.javascriptbank.com/nudging-text.html

Nudging text © JavaScriptBank.comThis attention craving text contains letters that constantly nudge one another. The effect is visible in both IE4+ and NS6.

Full version: jsB@nk » Text » Animation » Nudging text
URL: https://www.javascriptbank.com/nudging-text.html



JavaScript
<script language="JavaScript1.2">/*Nudging text by Matthias ([email protected])Modified by Dynamic Drive to function in NS6For this script and more, visit http://www.dynamicdrive.com*///configure messagemessage="JavaScriptBank.com"//animate text in NS6? (0 will turn it off)ns6switch=1var ns6=document.getElementById&&!document.allmes=new Array();mes[0]=-1;mes[1]=-4;mes[2]=-7;mes[3]=-10;mes[4]=-7;mes[5]=-4;mes[6]=-1;num=0;num2=0;txt="";function jump0(){if (ns6&&!ns6switch){jump.innerHTML=messagereturn}if(message.length > 6){for(i=0; i != message.length;i++){txt=txt+"<span style='position:relative;' id='n"+i+"'>"+message.charAt(i)+"</span>"};jump.innerHTML=txt;txt="";jump1a()}else{alert("Your message is to short")}}function jump1a(){nfinal=(document.getElementById)? document.getElementById("n0") : document.all.n0nfinal.style.left=-num2;if(num2 != 9){num2=num2+3;setTimeout("jump1a()",50)}else{jump1b()}}function jump1b(){nfinal.style.left=-num2;if(num2 != 0){num2=num2-3;setTimeout("jump1b()",50)}else{jump2()}}function jump2(){txt="";for(i=0;i != message.length;i++){if(i+num > -1 && i+num < 7){txt=txt+"<span style='position:relative;top:"+mes[i+num]+"'>"+message.charAt(i)+"</span>"}else{txt=txt+"<span>"+message.charAt(i)+"</span>"}}jump.innerHTML=txt;txt="";if(num != (-message.length)){num--;setTimeout("jump2()",50)}else{num=0;setTimeout("jump0()",50)}}</script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<h1><div id="jumpx" style="color:green"></div></h1><script>if (document.all||document.getElementById){jump=(document.getElementById)? document.getElementById("jumpx") : document.all.jumpxjump0()}elsedocument.write(message)</script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->