Posted by mike bowers
on 21.12.2007 07:00
Hello,

Is it possible to set the panelHeight of an accordion panel in 
percentage, or does it have to be pixels? I'm basically looking for a 
"100%" option...

Thanks very much!
Posted by Matt Brown
on 02.01.2008 23:15
Here is what I do on one of my pages. This keeps the accordion sized 
properly even when the user resizes the browser window. You will 
probably want to adjust CalcAccHt() based on the number of panels in 
your Accordion.

Matt


<script type='text/javascript'>
Rico.loadModule('Accordion');

var acc;
Rico.onLoad( function() {
  acc=new Rico.Accordion( '.accordionTabTitleBar', 
'.accordionTabContentBox', {panelHeight:CalcAccHt()} );
  setTimeout(function() {Event.observe(top, "resize", WinResize, 
false);},100);
});

function CalcAccHt() {
  var winht=RicoUtil.windowHeight();
  var txtht=$('accordion1').offsetTop;
  return Math.max(winht-txtht-200,100);
}

function WinResize(e) {
  acc.options.panelHeight=CalcAccHt();
  acc.initContent();
}

</script>