Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <style>
  4. #container {
  5. width: 1350px;
  6. height: 600px;
  7. position: relative;
  8. background-color:#B2ABAB;
  9. }
  10. #container2 {
  11. width: 555px;
  12. height: 640px;
  13. position: absolute;
  14. top:325px;
  15. left:450px;
  16. background-image: url(dabouza.png);
  17. background-repeat: no-repeat;
  18. }
  19.  
  20. #animate {
  21. width: 300px;
  22. height: 1000px;
  23. position: absolute;
  24. background-image: url(abbb.png);
  25. background-repeat: no-repeat;
  26. }
  27. #animate2 {
  28. width: 600px;
  29. height: 600px;
  30. position: absolute;
  31. background-image: url(logo.png);
  32. background-repeat: no-repeat;
  33. }
  34.  
  35.  
  36. </style>
  37. <body>
  38.  
  39. <p>
  40. <button onclick="myMove()">NOW</button>
  41. </p>
  42.  
  43. <div id ="container">
  44. <div id ="container2">
  45. <div id ="animate"></div>
  46. <div id ="animate2"></div>
  47.  
  48. </div>
  49.  
  50. <script>
  51.  
  52.  
  53. function all() {
  54. var first=setTimeout(myMove,0);
  55. firstt=setInterval(myMove,5000);
  56. alerte("first est bon");
  57. clearTimeout(first);
  58. clearInterval(firstt);
  59.  
  60. var second=setTimeout(myMovee,6000);
  61. secondd=setInterval(myMovee,3000);
  62. clearTimeout(second);
  63. clearInterval(secondd);
  64. alerte("second est bon");
  65.  
  66.  
  67.  
  68. function myMove() {
  69. var elem = document.getElementById("animate");
  70. var posx = 325;
  71. var posy = 450;
  72. var id = setInterval(frame,1);
  73. var dir = -1;
  74.  
  75.  
  76. function frame() {
  77. posx += dir;
  78. if (posx > 150) {
  79. dir = -1;
  80. sleep(2000);
  81. } else if (posx < 250) {
  82. dir = 1;
  83.  
  84. }
  85. if (posy == -1100) {
  86. posy = 400;
  87. } else {
  88. posy--;
  89. elem.style.top = posy + 'px';
  90. elem.style.left = posx + 'px';
  91.  
  92. }}
  93.  
  94. function myMovee() {
  95. var elem = document.getElementById("animate");
  96. var pos = -100;
  97. var id = setInterval(framee, -30000);
  98. elem.style.top = 400 + 'px';
  99.  
  100. function framee() {
  101. if (pos == 300) {
  102. clearInterval(id);
  103. } else {
  104. pos++;
  105. elem.style.left = pos + 'px';
  106. }
  107. }
  108. }
  109.  
  110.  
  111. }}
  112.  
  113. </script>
  114.  
  115. </body>
  116. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement