Advertisement
Guest User

Untitled

a guest
May 28th, 2015
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8" />
  5. <title>Test</title>
  6. <style>
  7. body {
  8. overflow: hidden
  9. }
  10. .obrazek {
  11. width: 100px;
  12. height: 100px;
  13. background: url('kursor.jpg')
  14. no-repeat;
  15. }
  16. .obrazy {
  17. opacity: 0.2
  18. }
  19.  
  20. td { border-collapse: separate;
  21. border-spacing: 10px 5px; }
  22. </style>
  23. </head>
  24. <body id="body">
  25. <p id="data1"></p>
  26.  
  27. <table align="center">
  28. <tr>
  29. <td><img class="obrazy"id="obrazek1" onclick="Duze(this)" onmouseover="Krycie(this)" onmouseout="Krycieout(this)" src="rsz_obrazek1.png"></td>
  30. <td><img class="obrazy"id="obrazek2" onclick="Duze(this)" onmouseover="Krycie(this)" onmouseout="Krycieout(this)" src="rsz_obrazek2.png"></td>
  31. </tr>
  32. <td><img class="obrazy" id="obrazek3" onclick="Duze(this)" onmouseover="Krycie(this)" onmouseout="Krycieout(this)" src="rsz_obrazek3.png"></td>
  33. <td><img class="obrazy" id="obrazek4" onclick="Duze(this)" onmouseover="Krycie(this)" onmouseout="Krycieout(this)" src="rsz_obrazek4.png"></td>
  34. </tr>
  35.  
  36.  
  37. <div class="obrazek" id="obrazek"></div>
  38. <script>
  39. var cialo = document.getElementById("body");
  40. var obr = document.getElementById("obrazek");
  41. cialo.onmousemove = function(e) {
  42. var pos_x = e.clientX;
  43. var pos_y = e.clientY;
  44. obr.style.display = "block";
  45. obr.style.position = "relative";
  46. obr.style.left = pos_x + 'px';
  47. obr.style.top = pos_y + 'px';
  48. }
  49. cialo.onclick = function() {
  50. document.getElementById("data1").innerHTML = new Date();
  51. }
  52.  
  53. function Duze(obrazy) {
  54. obrazy.style.height = "110%";
  55. obrazy.style.width = "110%";
  56. }
  57.  
  58. //function Normalne(obrazy) {
  59. // obrazy.style.height = "100%";
  60. // obrazy.style.width = "100%";
  61. // }
  62.  
  63. function Krycie(obrazy) {
  64. obrazy.style.opacity = 1;}
  65.  
  66. function Krycieout(obrazy) {
  67. obrazy.style.opacity = 0.2; }
  68.  
  69.  
  70.  
  71. </script>
  72. </body>
  73. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement