Button Text v1.0

Written by admin on December 25, 2008 – 7:00 am -

This script lets you click a button & see the text inside that button, as more text appears the button gets larger.
Author: Joshua Davison (ozyboy69@hotmail.com)

<!-- TWO STEPS TO INSTALL BUTTON TEXT V1.0:

  1.  Copy the coding into the HEAD of your HTML document
  2.  Add the last code into the BODY of your HTML document  -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
/*
OzyButton! v 1.0
*/
var outMsg = "";
var i = 0;
var lineNo = 1;
var timerDM=null;
var msg = " ";
function araVob() {
}
var ScreenLine = new araVob();

ScreenLine[1]  = “JavaScriptSource is the place!”
ScreenLine[2]  = “All the free JavaScripts you can handle”
ScreenLine[3]  = “You Can also visit”
ScreenLine[4]  = “http://JavaScripts.com”
ScreenLine[5]  = “Please keep submitting”
ScreenLine[6]  = “Let us know what you think”
ScreenLine[7]  = “Thanks Alot”
ScreenLine[8]  = ” Happy Coding!!”

var msgNum = 1;
var msgCnt = 8;
var typeSpeed = 200;
var pageLen = 4;
var delay=typeSpeed;
var r = 0;
var cr=”\r\n”
if (”3″ <=navigator.appVersion.charAt(0)) {
 var cr=”\n”
}
for (x = 1; x<=(msgCnt); x++) {
  ScreenLine[x] = ScreenLine[x] + cr;
}
msg = ScreenLine[1];
function DisplayMsg() {
  if (msg.length <= i || msg.charAt(i) == “\f”) {
    r=i;
    i=0;
    ChangeMsg();
  }
  outMsg = outMsg + msg.charAt(i);
  i++;
  if (msg.charAt(i) == “\f” || (lineNo == pageLen && i==msg.length)) {
    delay = 4000; }
  else {
  if (msg.charAt(i) == cr && msg != ” “+cr) {
    delay = 2000; }
  else {
    delay = typeSpeed; }
  }
  self.document.forms[0].elements[0].value=outMsg;
  timerDM = setTimeout(”DisplayMsg()”,delay);
}
function ChangeMsg() {
 msgNum++;
 if (msgCnt < msgNum) {
   msgNum = 1;
 }
 lineNo++;
 if (pageLen < lineNo || msg.charAt(r) == “\f”) {
  outMsg=ScreenLine[msgNum].charAt(i);
  i++;
  lineNo = 1;
 }
  msg = ScreenLine[msgNum];
}
//  End –>
</script>

</HEAD>

<!– STEP TWO: Copy this code into the BODY of your HTML document  –>

<BODY>

<FORM NAME= “msgform” ACTION=”">
<input type=”button” value=”Click Here To See” onClick=”DisplayMsg()”>
	</FORM>

<!– Script Size:  2.38 KB –>

Tags:
Posted in Buttons |

Post a Comment