Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head><script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  4. <meta charset="utf-8">
  5. <style>
  6. #container{
  7. width: 1220px;
  8. height: 650px;
  9. border: 3px solid blacke;
  10. background-color:grey;
  11. margin:0px;
  12. position:realtive;
  13. cursor: url("zad3.jpg"),auto;
  14. }
  15. #ramka{
  16. border: 5px solid lime;
  17. background-color: white;
  18. height: 70%;
  19. width: 50%;
  20. position: relative;
  21. margin: auto;
  22. }
  23. #ramka:hover {cursor: url("http://panoramix.ift.uni.wroc.pl/~wybieralski/cur/aim.cur"), auto;
  24. }
  25.  
  26. #buttons{
  27. position: relative;
  28. left:510px;
  29. margin:20px;
  30. }
  31. img{
  32. position:absolute;
  33. width:30px;
  34. height:40px;
  35.  
  36. }
  37. #punkty{
  38. width:100px;
  39. height: 20px;
  40. position:relative;
  41. border: 2px solid blue;
  42. marign:5px;
  43. left: 555px;
  44. bottom:5px;
  45. background-color: white;
  46.  
  47. }
  48. </style>
  49. </head>
  50. <body>
  51. <div id="container">
  52.  
  53. <h1 style="font:tahoma;text-align:center">Strzelanka</h1>
  54. <div id="punkty">
  55. </div>
  56.  
  57. <div id='ramka'>
  58.  
  59. </div>
  60.  
  61. <div id="buttons">
  62. <button onclick="run=objects()"> Start </button>
  63. <button onclick="run=false"> Stop </button>
  64. </div>
  65.  
  66. <script>
  67.  
  68. function objects() {
  69.  
  70. var i;
  71.  
  72. for (i=0; i<5; i++){
  73.  
  74. var posx = (Math.random() * $('img').width()).toFixed();
  75. var posy = (Math.random() * $('img').height()).toFixed();
  76.  
  77. $tarcza = $("<img src='zad3.jpg'>").css({
  78. 'left': 20*posx +'px',
  79. 'top': 10*posy + 'px'
  80. });
  81.  
  82. $tarcza.appendTo('#ramka').delay(200).fadeOut(5000);
  83. }}
  84. </script>
  85. <script>
  86. $('img').click(function(){
  87. $(this).remove();
  88. });
  89. </script>
  90. </div>
  91. </body>
  92. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement