how do i resize the height of the modalbox after loading content via ajax. I am trying to use the resizeToContent() function the following way but its not working.
<a href="/content" id="link111" onclick=" event.returnValue = false; return false;">Content</a>
<script type="text/javascript">
Event.observe('link111', 'click', function(event) { new Ajax.Updater('update','/content', {asynchronous:true, evalScripts:true, onComplete:function(request, json) {Modalbox.resizeToContent(); Element.hide('indicator');}, onLoading:function(request) {Element.show('indicator');}, requestHeaders:['X-Update', 'update']}) }, false);
Your code above looks correct. You are doing the right thing which is to call:
in the onComplete callback. Bear in mind, though it looks like you are aware, that the resize (according to Modalbox docs anyway) only resizes the height, not the width.
If the above is not working, I suggest you install something like Firebug within Firefox, and see if there’s not perhaps some other issue with your Javascript preventing the resize to be called correctly.