views:

105

answers:

0

Hey everybody,

I'm a newbie and need a little help. I am using this accordian script: http://www.nyokiglitter.com/tutorials/2columns.html

I would like to be able to print the whole accordion - open and collapsed.I saw this solution for jQuery:

http://stackoverflow.com/questions/186035/is-it-possible-to-print-a-div-that-is-hidden-by-jquerys-slideup-function

I'm not sure that solution will work for me. Here is the code:

function init(){

  var stretchers = document.getElementsByClassName('stretcher'); //div that stretches
  var toggles = document.getElementsByClassName('tab'); //h3s where I click on

  //accordion effect
  var myAccordion = new fx.Accordion(
   toggles, stretchers, {opacity: true, height: true, duration: 400}
  );

  //hash functions
  var found = true;
  toggles.each(function(h3, i){
   var div = Element.find(h3, 'nextSibling'); //element.find is located in prototype.lite
   if (window.location.href.indexOf(h3.title) > 0) {
    myAccordion.showThisHideOpen(div);
    found = true;
   }
  });
  if (!found) myAccordion.showThisHideOpen(stretchers[0]);
 }