SHARE
TWEET

Untitled

a guest Dec 9th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <DOCTYPE html>
  2. <html lang="pl">
  3. <head>
  4. <meta charset="utf-8">
  5. <head>
  6. <script type="text/javascript">
  7. function div2Click()
  8. {
  9. alert('Druga warstwa została kliknięta.');
  10. }
  11. function div1Click()
  12. {
  13. var div2 = document.getElementById('div2');
  14. div2.onclick = div2Click;
  15. alert('Druga warstwa będzie reagaowała na kliknięcia.');
  16. }
  17. </script>
  18. </head>
  19. <body>
  20. <div id="div1"
  21. style="background-color:#e0e0e0;
  22. width:200px;
  23. height:20px;
  24. text-align:center;"
  25. onclick="div1Click();"
  26. >
  27. To jest pierwsza wartstwa.
  28. </div>
  29. <div id="div2"
  30. style="background-color:#d0d0d0;
  31. width:200px;
  32. height:20px;
  33. text-align:center;"
  34. >
  35. To jest druga wartstwa.
  36. </div>
  37. </body>
  38. </html>
  39.  
  40.  
  41.  
  42.  
  43. 15
  44. <html>
  45. <head>
  46. <style type="text/css">
  47. #napis
  48. {
  49. position:absolute;
  50. background-color:yellow;
  51. width:210px;
  52. float:left;
  53. }
  54. </style>
  55. <script type="text/javascript">
  56. function Animacja()
  57. {
  58. var blok = document.getElementById('napis');
  59. if (parseInt(blok.style.left) < 50)
  60. {
  61. blok.style.left = "300px" ;
  62. }
  63. else
  64. {
  65. blok.style.left = (parseInt(blok.style.left) - 3)+"px";
  66. }
  67. }
  68. window.setInterval("Animacja()", 100);
  69. </script>
  70. </head>
  71. <body>
  72. <div id="napis" style="left: 300px;">JavaScript - jezyk skryptowy
  73. JavaScript - jezyk skryptowy
  74. JavaScript - jezyk skryptowy
  75. </div>
  76. </body>
  77. </html>
  78.  
  79.  
  80.  
  81. 16
  82. <html>
  83. <head>
  84. <style type="text/css">
  85. #baner
  86. {
  87. width:300px;
  88. height:180px;
  89. }
  90. </style>
  91. <body>
  92. <div>
  93. <p><img src="z1.jpg" id="baner" alt="ssss" onClick="setTimeout(Zmiana,2000);"/></p>
  94.  
  95. <script type="text/javascript">
  96. window.onClick = Zmiana;
  97. var Nr = 0;
  98. function Zmiana()
  99. {
  100. var obrazy = new Array('z1.png', 'z2.jpg', 'z3.jpg', 'z4.jpg', 'z5.jpg', 'z6.jpg');
  101. Nr ++;
  102. if (Nr == obrazy.length)
  103. {
  104. Nr = 0;
  105. }
  106. document.getElementById('baner').src = obrazy[Nr];
  107.  
  108. }
  109. </script>
  110. </div>
  111. </body>
  112. </head>
  113. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top