Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.76 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>HONWORK #3</title>
  6. <style>
  7. div {
  8. }
  9. input
  10. {
  11. width: 35px;
  12. height: 35px;
  13. }
  14. </style>
  15. </head>
  16. <body>
  17. <table>
  18. <tr>
  19. <td><input type="button" value="↖" id="BUTTONtopleft"></td>
  20. <td><input type="button" value="↑" id="BUTTONup"></td>
  21. <td><input type="button" value="↗" id="BUTTONtopright"></td>
  22. </tr>
  23. <tr>
  24. <td><input type="button" value="←" id="BUTTONleft"></td>
  25. <td></td>
  26. <td><input type="button" value="→" id="BUTTONright"></td>
  27. </tr>
  28. <tr>
  29. <td><input type="button" value="↙" id="BUTTONdownleft"></td>
  30. <td><input type="button" value="↓" id="BUTTONdown"></td>
  31. <td><input type="button" value="↘" id="BUTTONdownright"></td>
  32. </tr>
  33. </table>
  34.  
  35. <!-- <div id="box"></div>-->
  36.  
  37.  
  38.  
  39.  
  40. <img src="upORright.jpg" id="THEMAN">
  41.  
  42.  
  43. <script>
  44.  
  45.  
  46. var x = 0;
  47. var y = 0;
  48. document.getElementById("BUTTONright").onclick=function(){
  49. x+=5; //x=x+5;
  50. document.getElementById('THEMAN').style.marginLeft=x+'px';
  51. }
  52. document.getElementById("BUTTONleft").onclick=function(){
  53. x-=5; //x=x+5;
  54. document.getElementById('THEMAN').style.marginLeft=x+'px'; // <== string було Х, стало Хpx (рядковий)
  55. this.
  56. }
  57.  
  58. document.getElementById("BUTTONdown").onclick=function(){
  59. y+=5; //x=x+5;
  60. document.getElementById('THEMAN').style.marginTop=y+'px'; //
  61. }
  62. document.getElementById("BUTTONup").onclick=function(){
  63. y-=5; //x=x+5;
  64. document.getElementById('THEMAN').style.marginTop=y+'px';
  65. }
  66.  
  67. // document.getElementById('box1').onmouseover=function()
  68. // {
  69. // document.body.style.backgroundColor=this.style.backgroundColor;
  70. // }
  71. //
  72.  
  73. // document.getElementById('box').onclick=function()
  74. // {
  75. // this.style.backgroundColor='Yellow';
  76. // }
  77.  
  78. // document.getElementById('box').style.backgroundColor='blue'
  79.  
  80. // //типи даних
  81. // var x = 11; //number - числове значення, константа
  82. // var y = 'Hellow World'; //srting - строковий тип даних
  83. // var h = true; //boolean (true\false) - булевий
  84. // var z = undefined //пуста змінна без заданого значення
  85. // var j = null //обєктний тип, нуль
  86. //
  87. // //alert('Hello World');
  88. // //alert(y);
  89. // //y='Papa World';
  90. // //alert(y);
  91.  
  92. //onmouseover onmouseout
  93. </script>
  94.  
  95. </body>
  96. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement