Accordion fillSpace problem - it would show the whole content!

Accordion fillSpace problem - it would show the whole content!

Hi I am a pretty much a newbie to jQuery and I need some help please!

I am using the jQuery UI accordion menu and also using the fillSpace feature, so the accordion will conform its size to the size of the content. 

I am pulling an html document in via AJAX, and I know that I need event delegation to retrieve the new value of the window, but I have no idea how to do it. 


$('h3').click(function(){
var header= $(this).text();
   nextdiv= $(this).next('div');
nextdiv.load(header + "-AJAX.html");

In order for the fillSpace to work, it should change the size of the parent div. 

Here is the code for HTML:

<div id="accordion">
     <div>
<h3><a href="#">Third</a></h3>
<div>Nam dui erat, auctor a, dignissim quis.</div>
</div>
<div>
<h3 class="headertitle"><a href="#">stare</a></h3>
<div id="container"></div>
</div>
<div>
      </div>


How do I get the height of the div where I pulled the content in via AJAX and have that value added to the parent div, so the fillSpace would accommodate all my contents?

THANK YOU SO MUCH IN ADVANCE!!!!



-Michael
    • Topic Participants

    • moh