Advertisement
Guest User

Untitled

a guest
Jul 28th, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.61 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <head>
  3. <meta charset="utf-8">
  4. <title>Take the money and run</title>
  5. <style>
  6. body{
  7. text-align: center;
  8. }
  9. </style>
  10. </head>
  11. <body>
  12. <h1>Take the Money and Run</h1>
  13. <p><a id="first_paragraph" href="#">Click me first!</a></p>
  14. <div class="first_paragraph" style="color:white">
  15. This here's a story about Billy Joe and Bobbie Sue<br>
  16. Two young lovers with nothin' better to do<br>
  17. Than sit around the house, have fun, and watch the tube<br>
  18. And here is what happened when they decided to cut loose<br>
  19. </div>
  20.  
  21. <p><a id="second_paragraph" href="#">Click me Second!</a></p>
  22. <div class="second_paragraph" style="display:none">
  23. They headed down to, ooh, old El Paso<br>
  24. That's where they ran into a great big hassle<br>
  25. Billy Joe shot a man while robbing his castle<br>
  26. Bobbie Sue took the money and run
  27. </div>
  28.  
  29. <p><a id="first_chorus" href="www.google.com">Click me Third!</a></p>
  30. <div class="first_chorus" style="display:none">
  31. Go on take the money and run<br>
  32. Go on take the money and run<br>
  33. Go on take the money and run<br>
  34. Go on take the money and run
  35. </div>
  36.  
  37. <p><a id="third_paragraph" href="www.google.com">Click me Fourth!</a></p>
  38. <p class="third_paragraph" style="display:none">Billy Mack is a detective down in Texas</p>
  39. <p class="third_paragraph" style="display:none">You know he knkows just exactly what the facts is</p>
  40. <p class="third_paragraph" style="display:none">He ain't gonna let those two escape justice</p>
  41. <p class="third_paragraph" style="display:none">He makes his livin' off of the people's taxes</p>
  42.  
  43. <p><a id="fourth_paragraph" href="www.google.com">Click me Fifth!</a></p>
  44. <p class="fourth_paragraph" style="display:none">Bobbie Sue, whoa, whoa, she slipped away</p>
  45. <p class="fourth_paragraph" style="display:none">Billy Joe caught up to her the very next day</p>
  46. <p class="fourth_paragraph" style="display:none">They got the money, hey</p>
  47. <p class="fourth_paragraph" style="display:none">You know they got away</p>
  48. <p class="fourth_paragraph" style="display:none">They headed down south and they're still running today</p>
  49. <p class="fourth_paragraph" style="display:none">Singin' go on take the money and run</p>
  50.  
  51. <p><a id="second_chorus" href="www.google.com">Click me 6 times!</a></p>
  52. <p class="second_chorus" style="display:none">Go on take the money and run</p>
  53. <p class="second_chorus" style="display:none">Go on take the money and run</p>
  54. <p class="second_chorus" style="display:none">Go on take the money and run</p>
  55. <p class="second_chorus" style="display:none">Go on take the money and run</p>
  56. <p class="second_chorus" style="display:none">Go on take the money and run</p>
  57. <p class="second_chorus" style="display:none">Go on take the money and run</p>
  58.  
  59.  
  60.  
  61.  
  62. </body>
  63. <script>
  64. var firstLink = document.getElementById("first_paragraph");
  65. var secondLink = document.getElementById("second_paragraph");
  66. var thirdLink = document.getElementById("first_chorus");
  67. var fourthLink = document.getElementById("third_paragraph");
  68. var fifthLink = document.getElementById("fourth_paragraph");
  69. var sixthLink = document.getElementById("second_chorus");
  70.  
  71. firstLink.addEventListener("click", function(){
  72. document.body.style.backgroundColor = "rgba(255,0,255,1)";
  73. })
  74.  
  75. secondLink.addEventListener("click", function(){
  76. var secondPara = document.getElementsByClassName("second_paragraph")[0];
  77. secondPara.style.display = "block";
  78. })
  79.  
  80. thirdLink.addEventListener("click", function(event){
  81. event.preventDefault();
  82. var firstChorus = document.getElementsByClassName("first_chorus")[0];
  83. firstChorus.style.display = "block";
  84. })
  85.  
  86. fourthLink.addEventListener("click", function(event){
  87. event.preventDefault();
  88. var thirdPara = document.getElementsByClassName("third_paragraph");
  89. var i;
  90. for (i =0; i< thirdPara.length; i++){
  91. thirdPara[i].style.display = "block";
  92. }
  93. })
  94. fifthLink.addEventListener("click", function(event){
  95. event.preventDefault();
  96. var fourthPara = document.getElementsByClassName("fourth_paragraph");
  97. var i;
  98. for (i =0; i< fourthPara.length; i++){
  99. fourthPara[i].style.display = "block";
  100. }
  101. })
  102. var counter = 0;
  103. sixthLink.addEventListener("click", function(event){
  104. event.preventDefault();
  105. if(counter === 0) {
  106. var secondChorus = document.getElementsByClassName("second_chorus")[0];
  107. secondChorus.style.display = "block";
  108. counter++;
  109. }
  110. else if(counter === 1) {
  111. var secondChorus = document.getElementsByClassName("second_chorus")[1];
  112. secondChorus.style.display = "block";
  113. counter++;
  114. }
  115. else if(counter === 2) {
  116. var secondChorus = document.getElementsByClassName("second_chorus")[2];
  117. secondChorus.style.display = "block";
  118. counter++;
  119. }
  120. else if(counter === 3) {
  121. var secondChorus = document.getElementsByClassName("second_chorus")[3];
  122. secondChorus.style.display = "block";
  123. counter++;
  124. }
  125. else if(counter === 4) {
  126. var secondChorus = document.getElementsByClassName("second_chorus")[4];
  127. secondChorus.style.display = "block";
  128. counter++;
  129. }
  130. else if(counter === 5) {
  131. var secondChorus = document.getElementsByClassName("second_chorus")[5];
  132. secondChorus.style.display = "block";
  133. counter++;
  134. }
  135. })
  136.  
  137.  
  138.  
  139. //When the first link on the page is clicked,
  140. //the background color should change to something that is not white, blue, or black.
  141. //When the second through fifth links are clicked, the relevant part of the song should be displayed.
  142. //*(Hint: Notice that the href of the third link isn't #. Maybe some kind of default action should be prevented...)
  143. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement