Prototype: show hide navigation with


/ Published in: JavaScript
Save to your folder(s)

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

HTML looks like:

<a href="#">Repository (+) </a>
<ul>


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.