Full version: jsB@nk » Game » Poker » Roll the dice
URL: https://www.javascriptbank.com/roll-the-dice-index.html
Use this script when you don't have any real dice on hand.
Full version: jsB@nk » Game » Poker » Roll the dice
URL: https://www.javascriptbank.com/roll-the-dice-index.html
<style type="text/css">body{background-color:white;font-size:10pt;font-family:sans-serif;color:#00436e;}</style><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
<script language="javascript">var d1, d2;var ctr=0;var images=new Array();for(i=0;i<=6;i++){images[i]=new Image(); images[i].src='dice'+i+'.gif';}function rolldice(){document.f.t.value='';document.f.b.value=' Rolling..... ';if(ctr<6){showdice();ctr++;setTimeout('rolldice()',150);}else{ctr=0;showdice();document.f.t.value=d1+d2;document.f.b.value='Roll the dice...';}}function showdice(){d1=Math.floor(Math.random()*6+1);d2=Math.floor(Math.random()*6+1);document.images['d1'].src='dice'+d1+'.gif';document.images['d2'].src='dice'+d2+'.gif';}</script><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
<form name="f"><table><tr height="60"><td align="center"><img src="dice1.gif" name="d1"></td><td width="50"> </td><td align="center"><img src="dice1.gif" name="d2"></td></tr></table><br><br><b>Roll Total</b> <input type="text" size="2" value="" name="t" readonly onClick="document.f.b.focus()" onSelect="document.f.b.focus()"><br><br><input type="button" name="b" value="Roll the dice..." onClick="rolldice()"></form><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
http://javascriptbank.com/javascript/game/Roll_the_dice_images.zip