/ Published in: JavaScript
Used to make a show/hide nagigation w/ prototype js framework
HTML looks like:
<a href="#">Repository (+) </a>
<ul>
HTML looks like:
<a href="#">Repository (+) </a>
<ul>
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Event.observe(window, 'load', function() { $('repository_list').hide(); $('genre_list').hide(); $('collection_list').hide(); }); function toggleIt(type){ $(type).toggle(); if($(type).visible()){ $(type + '_a').update('(-)'); } else { $(type + '_a').update('(+)'); } }