Posted By

karindalziel on 06/02/09


Tagged


Versions (?)

Prototype: show hide navigation with


 / Published in: JavaScript
 

Used to make a show/hide nagigation w/ prototype js framework

HTML looks like:

<h3><a href="#">Repository <span>(+)</span> </a></h3>
<ul>
  1. Event.observe(window, 'load', function() {
  2. $('repository_list').hide();
  3. $('genre_list').hide();
  4. $('collection_list').hide();
  5. });
  6.  
  7. function toggleIt(type){
  8. $(type).toggle();
  9. if($(type).visible()){
  10. $(type + '_a').update('(-)');
  11. } else {
  12. $(type + '_a').update('(+)');
  13. }
  14.  
  15. }

Report this snippet  

You need to login to post a comment.