»
EnglishFrenchVietnamese

Print - Fortune Cookie Redux - JavaScriptBank.com

Full version: jsB@nk » Game » Fortune Cookie Redux
URL: https://www.javascriptbank.com/fortune-cookie-redux-index.html

Fortune Cookie Redux © JavaScriptBank.comTell your fortune and lucky numbers with the click of a button. Well, not actually your real fortune and lucky numbers, but it will give you some nice sayings and will generate random numbers. Easily customizable for different sayings. You can use either text or with graphics.

Full version: jsB@nk » Game » Fortune Cookie Redux
URL: https://www.javascriptbank.com/fortune-cookie-redux-index.html



CSS
<style type=text/css>#fortuneTwo, #numbersTwo {  height: 41px;  width: 275px;  margin: 0px auto 0px auto;  padding-top: 10px;}#numbersTwo {  height: 36px;  width: 275px;  margin: 0px auto 0px auto;  padding-top: 15px;}</style><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


JavaScript
<script type=text/javascript name="fortuenCookie.js">// Created by: John Hobbs :: http://www.velvetcache.org/var quotes = new Array(16) // Add your quotes below  quotes[0]="Your talents will be recognized and suitably rewarded.";  quotes[1]="He who hurries cannot walk with dignity.";  quotes[2]="Your success in life must be earned with earnest efforts.";  quotes[3]="You love peace.";  quotes[4]="A friend asks only for your time and not your money.";  quotes[5]="You will soon inherit a piece of land.";  quotes[6]="Your luck is about to change.";  quotes[7]="Things will soon go your way.";  quotes[8]="He who stands on toilet is high on pot.";  quotes[8]="Everybody is ignorant, only on different subjects.";  quotes[9]="Fortune favors the brave.";  quotes[10]="There is nothing permanent except change.";  quotes[11]="You haven't failed until you give up.";  quotes[12]="Your ability to juggle many tasks will take you far.";  quotes[13]="Broke is only temporary; poor is a state of mind.";  quotes[14]="Begin nothing until you have considered how it is finished.";  quotes[15]="A huge fortune at home is not as good as money in use.";function fortune(objID) {  var rand_int = Math.floor(Math.random()*16); // Get a number for picking the quote  document.getElementById(objID).innerHTML=(quotes[rand_int]); // Put the quote in the box}function numbers(objID) {  var space = ('      ') // Spacer for between numbers  var rand_inta = Math.floor(Math.random()*100); // Get first number  var rand_intb = Math.floor(Math.random()*100); // Get second number  var rand_intc = Math.floor(Math.random()*100); // Get third number  var rand_intd = Math.floor(Math.random()*100); // Get fourth number  var rand_inte = Math.floor(Math.random()*100); // Get fifth number  document.getElementById(objID).innerHTML=(rand_inta+space+rand_intb+space+rand_intc+space+rand_intd+space+rand_inte); //Print it all into the second box}</script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<span id="fortune"></span><br><a onclick="fortune('fortune')"><b>Click for your fortune:</b></a><p><span id="numbers"></span><br><a onclick="numbers('numbers')"><b>Click for your numbers:</b></a><!-- Or, to use the graphics ...  -->  <img src="cookie.jpg" alt="The Fortune Cookie">  <div id="fortuneTwo"></div>  <img src="submit.jpg" alt="sumbit" onclick="fortune('fortuneTwo');">  <div id="numbersTwo"></div>  <img src="submit2.jpg" alt="sumbit" onclick="numbers('numbersTwo');"><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


Files
http://javascriptbank.com/javascript/game/Fortune_Cookie_Redux/cookie.jpghttp://javascriptbank.com/javascript/game/Fortune_Cookie_Redux/submit2.jpghttp://javascriptbank.com/javascript/game/Fortune_Cookie_Redux/submit.jpg