views:

230

answers:

2

How to open an iframe modalbox in a rails app using the prototype javascript library?

+1  A: 

http://livepipe.net/control/window is a prototype library has good support for iframes in modal windows and can be used with javascript something like this:

html:

<a href='http://example.com/iframe'&gt;click me!</a>

javascript:

var modal = new Control.Modal($('modal'),{  
    overlayOpacity: 0.75,  
    className: 'modal',  
    fade: true,
    iframe: true  
});

Which will open the href of a link with the id of model in a lightbox

Andrew Nesbitt
A: 

Not prototype, but I will use leigeber's TinyBox: http://www.leigeber.com/2009/05/javascript-popup-box/

Victor P