Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html lang="pl">
- <head>
- <meta charset="UTF-8">
- <title>rzut kostką</title>
- <link href="style.css" rel="stylesheet">
- </head>
- <body>
- <div id="informacja">
- <p>„KLIKNIJ DWA RAZY NA KOSTKĘ ABY ZAGRAĆ JESZCZE RAZ</p>
- </div>
- <div id="box">
- <div>
- <input id="przycisk" type="button" value="start" onclick="start()">
- </div>
- <div>
- <img src="k1.png" id="kostka" ondblclick="kostka()">
- </div>
- </div>
- <script>
- function start(){
- var f = document.getElementById("kostka");
- f.style.transform = 'rotate(360deg)';
- var r= Math.floor(Math.random()*6+1);
- document.getElementById("kostka").src='k'+r+'.png';
- document.getElementById("przycisk").style='opacity:0;';
- document.getElementById("informacja").style='opacity:1;';
- }
- function kostka(){
- location.reload("start()");
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement