|
|
|
|
Scroll Text in TextBox
2 parts to this script ======================================================= <SCRIPT LANGUAGE="JavaScript"> <!-- Begin var CurrentMsg = 'Welcome To SmartSurat.com Surat's # Portal'; function update(msg) { var pad_str=""; n = msg.length; if(n<72) { pad = (73-n)/2; for(var i=0; i<pad; i++) { pad_str+=" "; } } CurrentMsg = pad_str + msg; document.messages.field.value = CurrentMsg; clearTimeout(timer); timer = setTimeout("idleMsg()",2500); } function MakeArray(n) { this.length=n; for(var i = 1; i<= n; i++) { this[i] = ""; } return(this); } var index = 1; var notice_num = 9; var notices = new MakeArray(notice_num); notices[1] = "Welcome To SmartSurat.com Surat's # Portal; notices[2] = "Thank you for visiting, I hope you find what you are searching for"; notices[3] = "This is the example of the form text javascript."; notices[4] = "Each message can be adjusted either in speed, or content"; notices[5] = "The length of the message box can also be personalized to fit your needs."; notices[6] = "More lines can be easily added to this script"; notices[7] = "Simply copy and paste the code into your page"; notices[8] = "Enjoy these scripts, and good luck with your site"; var timer = setTimeout('idleMsg()',1500); function nochange() { document.messages.field.value = CurrentMsg; } function idleMsg() { update(notices[index++]); if(index>notice_num) { index=1; } } // End --> </SCRIPT> ============================================================= <!-- --><center><font face="Helvetica"> <FORM name="messages" onSubmit="return false"> <input type="text" name="field" size=40 style="width:445" value=" " onFocus="self.status='This is a JavaScript information data field'; return true" onChange="nochange()"> </FORM></font> </CENTER> <!-- --> |