Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.13 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Expand/Collapse</title>
  6. <link rel="shortcut icon" href="images/favicon.ico">
  7. <link rel="stylesheet" href="index.css">
  8. <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
  9. <script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
  10. <script src="subset_expansion.js"></script>
  11. <script type="text/javascript">
  12. var loadFunction = function()
  13. {
  14. // gather the links
  15. var links = $("a").each(function(){});
  16.  
  17. // set an onclick listener
  18. links.click(function(evt)
  19. {
  20. var linkText = $(this).text();
  21.  
  22. if (linkText == "Show more")
  23. {
  24. // get the "hide" divs and expand them
  25. }
  26. else if (linkText == "Show less")
  27. {
  28. // get the "hide" divs and collapse them
  29. }
  30. })
  31. }
  32.  
  33. $(document).ready(loadFunction);
  34. </script>
  35. </head>
  36.  
  37. <body>
  38. <section id="jdom">
  39. <h1>Murach's JavaScript and DOM Scripting</h1>
  40. <h2>Book description</h2>
  41. <div>
  42. <p>You can read other JavaScript books from start to finish and still not
  43. know how to develop dynamic websites like you want to. That's because
  44. it's DOM scripting that lets you do things like run slide shows, handle image
  45. rollovers, rotate headlines, provide animation, and more. And it's a subject
  46. that's glossed over or ignored in most other books.</p>
  47. </div>
  48. <div class="hide">
  49. <p>But now, you can go from JavaScript beginner to DOM scripting expert in a
  50. single book! Fast-paced, professional, and packed with expert practices, our
  51. new JavaScript book guides you through each step as you learn how to program
  52. sites that enhance the user experience and ensure browser compatibility.</p>
  53. </div>
  54. <a href="#" id="">Show more</a>
  55.  
  56. <h2>About the author</h2>
  57. <div>
  58. <p>Ray Harris is an expert JavaScript programmer. That will be obvious to you
  59. as soon as you review the 20 complete applications that he presents in this
  60. book.</p>
  61. </div>
  62. <div class="hide">
  63. <p>Ray Harris is much more than a JavaScript programmer. He has a Master's degree
  64. in Computer Science and Artificial Intelligence. He worked on advanced
  65. research projects at the Air Force Research Lab while he was in the USAF.
  66. He taught information security and web development at the College of
  67. Technology in Raleigh, North Carolina. In fact, Ray has been programming
  68. and teaching since he was 12 years old.</p>
  69. <p>So when Ray said he wanted to write for us, it didn't take us long to hire
  70. him. Not only did he have the technical skills that we were looking for,
  71. but his previous writings showed that he had an uncommon ability to think,
  72. write, and teach.</p>
  73. </div>
  74. <a href="#">Show more</a>
  75.  
  76. <h2>Who this book is for</h2>
  77. <div>
  78. <p>Due to our unique presentation methods and this book's modular organization,
  79. this is the right book for any web developer who wants to use JavaScript effectively.</p>
  80. </div>
  81. <div class="hide">
  82. <p>Here's just a partial list of who can use this book:</p>
  83. <ul>
  84. <li>Web developers who know HTML and CSS and are ready to master JavaScript.</li>
  85. <li>Web developers who program in ASP.NET, JSP, or PHP on the server side and
  86. now want to master client-side coding.</li>
  87. <li>Web developers who have already read 3 or 4 JavaScript or DOM scripting books
  88. but still don't know how to do the type of DOM scripting that's required in
  89. real-world applications</li>
  90. </ul>
  91. </div>
  92. <a href="#">Show more</a>
  93.  
  94. </section>
  95. </body>
  96. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement