Tips Maker
Put this between your HEAD-tags:
|
<script LANGUAGE="JavaScript1.1"> function chngNext(){ document.tipMachine.shownext.value = "Y" tipMach(); } function chngPrev(){ document.tipMachine.showprev.value = "Y" tipMach(); } function tipMach(){ var totalTips = 8; if ((document.tipMachine.shownext.value == "Y") && (document.tipMachine.showprev.value == "N")){ var tipShow = (parseInt(document.tipMachine.nowShowing.value) +1); if (tipShow > totalTips){ var tipShow = 1;} } if ((document.tipMachine.showprev.value == "Y") && (document.tipMachine.shownext.value == "N")){ var tipShow = (parseInt(document.tipMachine.nowShowing.value) - 1); if (tipShow < 1){ var tipShow = totalTips;} } if ((document.tipMachine.showprev.value == "N") && (document.tipMachine.shownext.value == "N")){ var tipShow = (Math.random() * totalTips); var tipShow = Math.ceil(tipShow);} if (tipShow == 1) { var _tip = "Paste this code into your page and jazz up the formatting however you want. Then put in your tips"; } if (tipShow == 2) { var _tip = "The script can handle an unlimited number of tips.You're only limited by your imagination!"; } if (tipShow == 3) { var _tip = "The best part about this script is it doesnt reload the page."; } if (tipShow == 4) { var _tip = "Sometimes the low tech 'it doesnt break' solution is the best."; } if (tipShow == 5) { var _tip = "Put your tips here or turn it into your FAQ page."; } if (tipShow == 6) { var _tip = "Isn't Javascript cool! And it's so EASY to use."; } if (tipShow == 7) { var _tip = "You dont have to put tips here. You could put any text you want to display like this in here."; } if (tipShow == 8) { var _tip = "Another TIP you can choose to set"; } document.tipMachine.tipsHere.value = _tip; document.tipMachine.nowShowing.value = tipShow; document.tipMachine.ofTotal.value = totalTips; document.tipMachine.shownext.value = "N"; document.tipMachine.showprev.value = "N"; } </script> |
|
<form NAME="tipMachine" METHOD="post"> <input type="hidden" name="shownext" value="N"><input type="hidden" name="showprev" value="N"><div align="center"><center><p><textarea NAME="tipsHere" ROWS="5" COLS="50" WRAP="virtual" onFocus="this.blur();">The TOO COOL Tip Machine!</textarea><br> <input TYPE="button" VALUE="RANDOM" onClick="tipMach();"> <input TYPE="button" VALUE="NEXT" onClick="chngNext();"><input TYPE="button" VALUE="PREV" onClick="chngPrev();"> <br> Now showing tip number: <input TYPE="text" SIZE="3" NAME="nowShowing" value="1" onFocus="this.blur();"> of <input TYPE="text" SIZE="3" NAME="ofTotal" onFocus="this.blur();"><br> </p> </center></div> </form> |
Free JavaScripts provided
by Winfolinx.com