Advertisement
Guest User

krugovi

a guest
Nov 12th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.69 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.  
  4. <head>
  5. <title></title>
  6. <meta charset="UTF-8">
  7. <meta name="viewport" content="width=device-width, initial-scale=1">
  8. <script src="new3.js"></script>
  9. <style>
  10.  
  11. #cetvrtidiv {
  12. position:relative;
  13. top:10px;
  14. display:block;
  15. padding-top:95px;
  16. border-radius: 0px 50px 0px 0px;
  17. background-color:lightblue;
  18. width:200px;
  19. height:105px;}
  20.  
  21. </style>
  22. </head>
  23. <body>
  24. <div id="prvidiv" align="center" style="position:absolute;
  25. left:250px;
  26. display:block;
  27. padding-top:95px;
  28. border-radius: 50%;
  29. background-color:red;
  30. width:200px;
  31. height:105px;" >ovo je prvi div</div>
  32. <div id="drugidiv" align="center" style="display:block;
  33. padding-top:95px;
  34. border-radius: 50%;
  35. background-color:green;
  36. width:200px;
  37. height:105px;" >ovo je drugi div</div>
  38. <div id="trecidiv" onmouseover="povecanje()" onmouseleave="smanjenje()" align="center" style="position:absolute;
  39. left:500px;
  40. top:10px;
  41. display:block;
  42. padding-top:95px;
  43. border-radius: 50%;
  44. background-color:blue;
  45. width:200px;
  46. height:105px;" >ovo je treci div</div>
  47.  
  48.  
  49.  
  50. <button id="promena"onclick="alert('pozdrav')">poruka</button><br><br>
  51. <button id="sakrij"onclick="sakrij()">sakrij</button><br><br>
  52. <button id="sadrzaj"onclick="sadrzaj()">sadrzaj</button>
  53. <button id="sadrzaj"onclick="vrati()">vrati</button><br><br>
  54. <button id="boja"onclick="boja()">boja</button>
  55.  
  56. <div id="cetvrtidiv">
  57. <input id="broj" type="number" name="fname" >Unesi broj</input><br>
  58. <button id="pogodi" onclick="pogodi()">Pogodi broj</button>
  59. </div>
  60.  
  61.  
  62. </body>
  63. </html>
  64.  
  65. //// skripta
  66. function sadrzaj(){
  67. document.getElementById("prvidiv").innerHTML += "<ul><li>C#</li><li>java</li></ul>";
  68. }
  69.  
  70. function vrati(){
  71. document.getElementById("prvidiv").innerHTML = "ovo je drugi div";
  72.  
  73. }
  74.  
  75. function boja(){
  76. var sel = document.getElementById("drugidiv");
  77. if (sel.style.backgroundColor=="green") {
  78. sel.style.backgroundColor ="blue";
  79. } else {
  80. if(sel.style.backgroundColor=="red"){
  81. sel.style.backgroundColor ="green"
  82. } else {
  83. if(sel.style.backgroundColor=="blue"){
  84. sel.style.backgroundColor ="red"
  85. }
  86. }
  87. }
  88.  
  89.  
  90. var sel = document.getElementById("prvidiv");
  91. if (sel.style.backgroundColor=="green") {
  92. sel.style.backgroundColor ="blue";
  93. } else {
  94. if(sel.style.backgroundColor=="red"){
  95. sel.style.backgroundColor ="green"
  96. } else {
  97. if(sel.style.backgroundColor=="blue"){
  98. sel.style.backgroundColor ="red"
  99. }
  100. }
  101. }
  102.  
  103. var sel = document.getElementById("trecidiv");
  104. if (sel.style.backgroundColor=="green") {
  105. sel.style.backgroundColor ="blue";
  106. } else {
  107. if(sel.style.backgroundColor=="red"){
  108. sel.style.backgroundColor ="green"
  109. } else {
  110. if(sel.style.backgroundColor=="blue"){
  111. sel.style.backgroundColor ="red"
  112. }
  113. }
  114. }
  115. }
  116.  
  117. function sakrij(){
  118. var sel = document.getElementById("prvidiv");
  119. if (sel.style.display=="block") {
  120. sel.style.display ="none";
  121. } else {
  122. sel.style.display ="block";
  123. }
  124. }
  125.  
  126. function povecanje(){
  127. document.getElementById("trecidiv").style.width = "300px";
  128. }
  129.  
  130. function smanjenje(){
  131. document.getElementById("trecidiv").style.width = "200px";
  132. }
  133.  
  134. function pogodi()
  135. {
  136. if(document.getElementById("broj").value == "3") {
  137. alert("Pogodili ste!");
  138. }
  139. else { alert("Niste pogodili."); }
  140.  
  141.  
  142.  
  143. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement