Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2015
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC
  2. "-//W3C//DTD XHTML 1.0 Transitional//EN"
  3. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4.  
  5. <html xmlns="http://www.w3.org/1999/xhtml">
  6. <head>
  7. <title>Hide/Show</title>
  8. <style type="text/css">
  9. a {
  10. text-decoration: none;
  11. outline: none;
  12. }
  13. div#page {
  14. margin: 60px auto;
  15. border: 1px solid #dedede;
  16. width: 910px;
  17. }
  18. .TogWrap {
  19. width: 400px;
  20. padding: 22px;
  21. }
  22. #togTrigger {
  23. border: 1px solid #bebebe;
  24. padding: 7px 8px;
  25. background: #df7623;
  26. color: #fff;
  27. }
  28. .togContent {
  29. margin-top: 9px;
  30. border: 1px solid #bebebe;
  31. padding: 16px 10px 10px 10px;
  32. background: #ededed;
  33. }
  34. </style>
  35. <script type="text/javascript">
  36. <!-- HIDE FROM OLD BROWSERS
  37. /* <![CDATA[ */
  38.  
  39. var oVTog = {
  40. toggle: function (el) {
  41. oVTog.container = el.parentNode;
  42. oVTog.para = oVTog.container.getElementsByTagName('p')[0];
  43. oVTog.para.style.display = "none";
  44.  
  45. el.onmouseover = function () {
  46. oVTog.para.style.display = '';
  47. return false;
  48. };
  49. el.onmouseout = function () {
  50. oVTog.para.style.display = 'none';
  51. return false;
  52. };
  53. el.onclick = function () {
  54. oVTog.para.style.display = oVTog.para.style.display == 'none' ? '' : 'none';
  55. return false;
  56. };
  57. }
  58. };
  59. window.onload = function () {
  60. var l = document.getElementById('togTrigger');
  61. oVTog.toggle(l);
  62. };
  63.  
  64. /* ]]> */
  65. //END HIDING -->
  66. </script>
  67. </head>
  68. <body id="bd">
  69.  
  70.  
  71.  
  72. <div id="theTog" class="TogWrap">
  73. <a href="#" id="togTrigger">Lorem ipsum One</a>
  74. <p class="togContent">
  75. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris magna.
  76. Suspendisse accumsan elit non tellus. Curabitur eros justo, malesuada
  77. convallis, sagittis vitae, convallis sit amet, lectus.
  78. </p>
  79. </div>
  80.  
  81. </div>
  82.  
  83. </body>
  84. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement