Multiple Custom iframes

I am using the Control.Modal to pop up content in iframes.

I am using unique ID's for each modal as I have multiple modal links on my pages at a time, however, only the first two modals (in order) will display correctly, the other ones will just pop up in a new window full screen rather than in the nice overlay box.

Below is the code that I am using. I am using a custom ifram template as well. Event.observe(window,'load',function(){

    new Control.Modal($('requestfriend'),
    {
        iframe: true,
        iframeTemplate: new Template('<iframe allowtransparency="true" src="#{href}" width="100%" height="100%" scrolling="no" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" id="#{id}"></iframe>'),
        width: 750,
        height: 400
    }
    );
    new Control.Modal($('share'),
    {
        iframe: true,
        iframeTemplate: new Template('<iframe allowtransparency="true" src="#{href}" width="100%" height="100%" scrolling="no" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" id="#{id}"></iframe>'),
        width: 750,
        height: 400
    }
    );
    new Control.Modal($('setgoals'),
    {
        iframe: true,
        iframeTemplate: new Template('<iframe allowtransparency="true" src="#{href}" width="100%" height="100%" scrolling="no" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" id="#{id}"></iframe>'),
        width: 750,
        height: 500
    }
    );
    new Control.Modal($('takequiz'),
    {
        iframe: true,
        iframeTemplate: new Template('<iframe allowtransparency="true" src="#{href}" width="100%" height="100%" scrolling="no" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" id="#{id}"></iframe>'),
        width: 815,
        height: 550
    }
    );
    new Control.Modal($('nickelbag'),
    {
        iframe: true,
        iframeTemplate: new Template('<iframe allowtransparency="true" src="#{href}" width="100%" height="100%" scrolling="no" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" id="#{id}"></iframe>'),
        width: 815,
        height: 550 
    }
    );      
});
 function addCloseLink() { 
    new Insertion.Bottom('modal_container', "<p><a href='javascript:void(0)' id='model_link_close' onClick='test()'>close</p>");
}
function test(){
 var current_modal = Control.Modal.current;
 current_modal.close();
}

Posted June 14th, 2007 at 12:37pm by mrbaseball9

whoops I think I had a type in the code class.

Posted June 14th, 2007 at 12:38pm by mrbaseball9

Login or Register to Post