Go Back   Themers Club : Computers , Mobiles and Web Development Themes > Webmaster forum > Scripts and Tools

Scripts and Tools Share your free scripts , tools , icons, fontz, screen savers , etc here.

Reply
 
Thread Tools Display Modes
  #1  
Old 10-05-2009, 03:07 PM
JavaScriptBank JavaScriptBank is offline
Senior Member
 
Join Date: Jul 2009
Posts: 207
Rep Power: 16
JavaScriptBank is on a distinguished road
Default Free JavaSccript codes

Helpful JavaScript for Web development

JavaScript - Random Text2

This JavaScript displays a message under the random characters.... detail

[IMG]hxxp ://w w w.javascriptbank. com/javascript.images/text/javascript-random-text2.jpg[/IMG]
Demo: JavaScript - Random Text2

How to setup

Step 1: Use JavaScript code below to setup the script
JavaScript
Code:
<script language="JavaScript">
<!--
  var quoteStr;
  var quoteNum;
  var quoteDis;
  var quoteLen;
  var quoteLoc;
  var quotePic;
  var quoteMax;
  var numQuote;
  var charDelay;
  var quoteDelay;
  var delayCntr;

  // Copyright 2002 by JefferyPSanders. com
  // jps@jefferypsanders. com
  // Jeffery P Sanders  6/28/02

 function funcQuote() {
   this[0] = "Visit Jeff Sanders at hxxp ://w w w.jefferypsanders. com!";
   this[1] = "A lot of people mistake a short term memory for a clear conscience.";
   this[2] = "Friends help you move. REAL friends help you move bodies.";
   this[3] = "LOTTERY: A tax on people who are bad at math.";
   this[4] = "Save the whales. Collect the whole set.";
   this[5] = "A man needs a good memory after he has lied.";
   this[6] = "Always remember that your are unique, just like everyone else.";
   this[7] = "Pentiums melt in your PC, not in your hand.";
   this[8] = "OOPS! My brain just hit a bad sector.";
   this[9] = "90% of all statistics are made up.";
   this[10] = "Warning: Dates in calendar are closer than they appear.";
   this[11] = "Don't take it too seriously, you won't get out alive.";
   this[12] = "COINCIDENCE happens.";
   this[13] = "A flashlight is a case for holding dead batteries.";
   this[14] = "Few women admit their age. Few men act theirs.";
   this[15] = "Give me ambiguity or give me something else.";
   this[16] = "C program run. C program crash. C programmer quit.";
   this[17] = "Did anyone see my lost carrier?";
   this[18] = "I used to have a handle on life.  Then it broke.";
   this[19] = "Beam me aboard, Scotty.....Sure,... will a 2x4 do?";
   this[20] = "Double your drive space - delete windows.";
   this[21] = "A little work, a little sleep, a little love and it's all over.";
   this[22] = "Artificial intelligence usually beats real stupidity.";
   this[23] = "Change is unevitable, except from a vending machine.";
   this[24] = "I.R.S.: We've got what it takes to take what you've got.";
   this[25] = "I don't suffer from insanity. I enjoy every minute of it.";
   this[26] = "Energizer Bunny Arrested!  Charged with battery.";
   this[27] = "The gene pool could use a little chlorine.";
   this[28] = "We are born naked, wet, and hungry. Then things get worse.";
  }
  function getQuote() {
   delayCntr = delayCntr + 1;
   quoteLoc = quoteLoc - 1;
   if (delayCntr > quoteDelay) {
      delayCntr = 100;
      quoteLen = 0;
      quoteLoc = 0;
      quoteNum = Math.floor(Math.random() * numQuote);
      quoteStr = makeQuote[quoteNum];
      quoteLen = quoteStr.length;
      quoteMax= quoteStr.length;
      padQuote();
   }
  }

  function disQuote() {
   quoteLoc = quoteLoc + 1;
   if (quoteLoc > quoteMax) {
    if (delayCntr > 50) {
      delayCntr = 0;
    }
    getQuote();
   }
   quoteDis = quoteStr.substring(0, quoteLoc);
   for (var i = quoteLoc; i < quoteMax; i++){
    var charone;
    charone = quoteStr.substring(i, i + 1);
    var rdnum;
    rdnum = Math.floor(Math.random() * 57)
    quoteDis = "" + quoteDis + quotePic.substring(rdnum, rdnum + 1);
   }
  }
  function padQuote () {
   var spacePad = quoteMax - quoteStr.length;
   var frontPad = Math.floor(spacePad / 2);
   for (var i = 0; i < frontPad; i++) {
    quoteStr = " " + quoteStr;
   }
   for (var i = quoteStr.length; i < quoteMax; i++) {
    quoteStr= "" + quoteStr + " ";
   }
  }
  function loopQuote() {
   document.all.txt1.innerHTML="<span>"+quoteDis+"</span>";
   disQuote();
   setTimeout ("loopQuote();", charDelay);
  }
  function startQuote() {
   quoteStr = "";
   quoteNum = 0;
   quoteDis = "";
   quoteLen = 0;
   quoteLoc = 0;
   quotePic = "abcdefghjkmnopqrstuvwxyzABCEDEFGHJKLMNOPQRSTUVXYZ234567890";
   quoteMax = 70;
   numQuote = 29;
   delayCntr=100;
   charDelay = 50;
   quoteDelay = 50;
   makeQuote = new funcQuote();
   getQuote();
   disQuote();
   loopQuote();
  }
//-->
    </script>
	<!--
    	This script downloaded from w w w.JavaScriptBank. com
    	Come to view and download over 2000+ free javascript at w w w.JavaScriptBank. com
	-->
Step 2: Copy & Paste HTML code below in your BODY section
HTML
Code:
<body onload="startQuote();">
<div id="txt1" style="font-family: Courier; font-weight: bold;" align="center">
		JavaScriptBank. com - Bank of over 2000+ free JavaScripts
    </div>
</body>
	<!--
    	This script downloaded from w w w.JavaScriptBank. com
    	Come to view and download over 2000+ free javascript at w w w.JavaScriptBank. com
	-->





Command to print web page in javascript - Javascript Time Picker - JavaScript Go To URL Box
Quote:
Originally Posted by Copyright
The Site may provide, or third parties may provide, links to non-JavaScriptBank.com Internet World Wide Web sites or resources. Because JavaScriptBank.com has no control over such sites and resources, you acknowledge and agree that JavaScriptBank.com is not responsible for the availability of such external sites or resources, and does not endorse and is not responsible or liable for any content, advertising, products, or other materials on or available from such sites or resources. You further acknowledge and agree that JavaScriptBank.com shall not be responsible or liable, directly or indirectly, for any damage or loss caused or alleged to be caused by or in connection with use of or reliance on any such content, goods or services available on or through any such site or resource.
Reply With Quote
  #2  
Old 02-22-2010, 11:39 AM
Niizmo Niizmo is offline
Junior Member
 
Join Date: Feb 2010
Posts: 5
Rep Power: 0
Niizmo is on a distinguished road
Default

Can U Show A Preview
Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 11:05 PM.


Powered by vBulletin® Version 3.7.6
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.