Posted By

limonn on 10/03/06


Tagged


Versions (?)

show text by clicking a link


 / Published in: HTML
 

URL: http://www.irt.org/script/1261.htm

como google ads

  1.  
  2.  
  3. <script type="text/javascript" language="JavaScript"><!--
  4. function toggle(object) {
  5. if (document.getElementById) {
  6. if (document.getElementById(object).style.visibility == 'visible')
  7. document.getElementById(object).style.visibility = 'hidden';
  8. else
  9. document.getElementById(object).style.visibility = 'visible';
  10. }
  11.  
  12. else if (document.layers && document.layers[object] != null) {
  13. if (document.layers[object].visibility == 'visible' ||
  14. document.layers[object].visibility == 'show' )
  15. document.layers[object].visibility = 'hidden';
  16. else
  17. document.layers[object].visibility = 'visible';
  18. }
  19.  
  20. else if (document.all) {
  21. if (document.all[object].style.visibility == 'visible')
  22. document.all[object].style.visibility = 'hidden';
  23. else
  24. document.all[object].style.visibility = 'visible';
  25. }
  26.  
  27. return false;
  28. }
  29. //--></script>
  30.  
  31. <style type="text/css"><!--
  32. .myStyle { position: absolute; visibility: hidden; }
  33. //--></style>
  34.  
  35. </head>
  36.  
  37.  
  38. <a href="#" onClick="toggle('myLayer1')">click me</a>
  39.  
  40. <div id="myLayer1" class="myStyle">
  41.  
  42. <table bgcolor="#ffffcc"><tr><td>
  43. This text is hidden from view.<br>It is revealed when the link<br>is clicked
  44. </td></tr></table>
  45.  
  46. </div>
  47.  
  48. </body>
  49.  
  50. </html>

Report this snippet  

You need to login to post a comment.