We Recommend

HTML: The Definitive Guide HTML: The Definitive Guide
They teach you that learning HTML is like learning any other language and that reading a book of rules can only take you so far. Readers begin writing what may be their first Web page just two pages into the book's second chapter. From there on, they provide a wide range of HTML coding to allow readers to learn from good examples. The book includes a handy "cheat sheet" of HTML codes for quick reference.


Posted By

fredaudet on 07/18/08


Tagged

show div javascript hide dynamic


Versions (?)


Who likes this?

1 person has marked this snippet as a favorite

codesmoker


Show/Hide divs


Published in: HTML 


  1. function showlayer(layer){
  2. var myLayer = document.getElementById(layer).style.display;
  3. if(myLayer=="none"){
  4. document.getElementById(layer).style.display="block";
  5. } else {
  6. document.getElementById(layer).style.display="none";
  7. }
  8. }
  9.  
  10.  
  11. /* FEED ICONS */
  12. .feed-yahoo{
  13. background:url(http://lh5.ggpht.com/antonio.lupetti/
  14. SGkbSeViXCI/AAAAAAAABq0/VKFk--P6rzg/s144/feed-yahoo.png) no-repeat;
  15. }
  16. .feed-newsgator{
  17. background:url(http://lh6.ggpht.com/antonio.lupetti/
  18. SGkZt949soI/AAAAAAAABqk/0K_xT635iWc/s144/feed-newsgator.png) no-repeat;
  19. }
  20. .feed-netvibes{
  21. background:url(http://lh6.ggpht.com/antonio.lupetti/
  22. SGkZsku-McI/AAAAAAAABqc/geaegB--2R0/s144/feed-netvibes.png) no-repeat;
  23. }
  24. .feed-bloglines{
  25. background:url(http://lh6.ggpht.com/antonio.lupetti/
  26. SGkZlVYv_1I/AAAAAAAABqM/HSGE2JRVGA8/s144/feed-bloglines.png) no-repeat;
  27. }
  28. .feed-xml{
  29. background:url(http://lh4.ggpht.com/antonio.lupetti/
  30. SGkZvPomXRI/AAAAAAAABqs/hXOtnqszlws/s144/feed-xml.png) no-repeat;
  31. }
  32. .feed-google{
  33. background:url(http://lh4.ggpht.com/antonio.lupetti/
  34. SGkZrkp8XCI/AAAAAAAABqU/Yp-Rb_1L98k/s144/feed-google.png) no-repeat;
  35. }
  36.  
  37.  
  38.  
  39. /* -------------------------------- */
  40. /* RSS MENU */
  41. #rss-menu{
  42. padding:10px;
  43. padding-top:0px;
  44. width:270px;
  45. border:solid 1px #CCCCCC;
  46. margin-top:10px;
  47. font-size:11px;
  48. position:absolute;
  49. background:#FFFFFF;
  50. margin-left: 446px; /* Change it with your custom distance from the left margin */
  51. top: 82px; /* Change it with your custom distance from top */
  52. z-index:2;
  53. }
  54.  
  55.  
  56.  
  57. <div id="rss-menu">
  58. <h2>Subscribe My Feeds</h2>
  59.  
  60. <li class="feed-xml">
  61. <a href="http://feeds.feedburner.com/Woork">Subscribe to RSS Feed</a&gt;
  62. </li>
  63.  
  64. <li class="feed-yahoo">
  65. <a href="http://add.my.yahoo.com/rss?url=http://feeds.feedburner.com/Woork">Add to My Yahoo</a>
  66. </li>
  67.  
  68. <li class="feed-newsgator">
  69. <a href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http://feeds.feedburner.com/Woork">Subscribe in NewsGator</a>
  70. </li>
  71.  
  72. <li class="feed-bloglines">
  73. <a href="http://www.bloglines.com/sub/ http://feeds.feedburner.com/Woork">Subscribe with Bloglines</a>
  74. </li>
  75.  
  76. <li class="feed-netvibes">
  77. <a href="http://www.netvibes.com/subscribe.php?url=http://feeds.feedburner.com/Woork">Add to Netvibes</a>
  78. </li>
  79.  
  80. <li class="feed-google">
  81. <a href="http://fusion.google.com/add?feedurl=http://feeds.feedburner.com/Woork">Add to Google</a>
  82. </li>
  83.  
  84. </ul
  85. </div>

Report this snippet 

You need to login to post a comment.