I've been battling with a few
lightbox scripts, attempting to put an ajax window on top of an existing window. There's no shortage of these things in the Javascript universe and my path through them looked like this:
Original Lightbox won't work because it only hosts images.
Particletree Lightbox gone wild Seemed fine at first, but won't dynamically resize to the size of the content.
Greybox is fantastic but relies on an Iframe which prevents javascript (or, at least,
prototype) from being able to script elements with $().
ModalBox does all the above and is therefore the winner. Note that when it says you need the files in an "includes/" directory they mean it, it has to be called "includes/"
Note also I have a little hack to resize the window, which can only be done relatively ... there is no call to "resize to fit the content again" unless you completely reload the content. In my case I had a div at the bottom so I passed the 'old' height of the div as part of the ajax call (
$('messages').getHeight()) then passed this back again as part of a dynamically created script (
Modalbox.resize(0,$('messages').getHeight()-{{divheight}});) that gets called by prototype when the update finishes.