»
EnglishFrenchVietnamese

Print - Simple Text Rotate - JavaScriptBank.com

Full version: jsB@nk » Text » Simple Text Rotate
URL: https://www.javascriptbank.com/simple-text-rotate.html

Simple Text Rotate © JavaScriptBank.comThis JavaScript will display random text messages, which can be styled using CSS. Add as many as you want.

Full version: jsB@nk » Text » Simple Text Rotate
URL: https://www.javascriptbank.com/simple-text-rotate.html



CSS
<style type="text/css">/*Created by: mrhoo Web Site: http://www.webdeveloper.com/forum/showthread.php?t=143761 *//* Be sure to add or delete IDs below, according tothe number of messages that you have. */#ran1,#ran2,#ran3,#ran4 {  display:none;}</style><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


JavaScript
<script language="javascript">// Created by: mrhoo | http://www.webdeveloper.com/forum/showthread.php?t=143761function messageLoad() {  // Be sure to change the number following the "*" below to match the number of messages.  var wch=Math.floor(Math.random()*4+1);  document.getElementById('ran'+wch).style.display='inline';}// Multiple onload function created by: Simon Willison// http://simon.incutio.com/archive/2004/05/26/addLoadEventfunction addLoadEvent(func) {  var oldonload = window.onload;  if (typeof window.onload != 'function') {    window.onload = func;  } else {    window.onload = function() {      if (oldonload) {        oldonload();      }      func();    }  }}addLoadEvent(function() {  messageLoad();});</script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<p id="randomP"><strong>Quote of the Day:</strong><span id="ran1"><strong><em>If it aint broke. Get a bigger hammer.</em></strong></span><span id="ran2"><strong><em>Change is inevitable; progress is optional.</em></strong></span><span id="ran3"><strong><em>Do not attribute any action to malice that can be explained by stupidity.</em></strong></span><span id="ran4"><strong><em>The box said "Requires Windows 95, NT, or better", so I installed Linux.</em></strong></span></p><input type="button" value="Reload this page" onclick="window.location=document.location;" /><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->