kyleAI_13

Must click twice to toggle hide/show div

Jun 25th, 2016
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.52 KB | None | 0 0
  1. **Javascript:**
  2. <!--
  3.    function toggle_visibility(id) {
  4.       var e = document.getElementById(id);
  5.       if(e.style.display == 'block')
  6.          e.style.display = 'none';
  7.       else
  8.          e.style.display = 'block';
  9.    }
  10. //-->
  11.  
  12.  
  13.  
  14. **HTML**
  15. <h4><a data-toggle='irc' style='cursor:cell;' onclick="toggle_visibility('irc');"'>#dorito IRC</a></h4>
  16. <center><div style='padding:12px;' id='irc' class='irc'>MY IRC IFRAME HERE</div></center>
  17.  
  18.  
  19.  
  20.  
  21. **CSS**
  22. #irc {
  23.     display: block;
  24. }
  25. .irc {
  26.     display: block;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment