Control.Modal opened programmatically

Hi,

I've been given some code which opens a Control.Modal when a link is clicked. Thusly:

Event.observe(window,'load',function(){
        new Control.Modal($('new_window'),{
            iframe: true,
            width: 600,
            height: 420,
            overlayCloseOnClick: false
        });
    });

... and then a normal link with an 'id' of "new_window".

That works great, but what I need to do is set something up to automatically run that code based on a condition and not on the click of a link. Any ideas how this is easily achieved? I've tried wrapping up that code in a function that I could call on demand (stroing the link to the page I want to open in a hidden 'a' or 'link' element), but this has failed. Is there something I'm missing? Like a specific function that performs this sort of thing?

Cheers!

Posted September 17th, 2007 at 11:32am by weaklemondrink

Ignore this, guys... I've since realised there's other threads on this topic. Sorry.

Posted September 17th, 2007 at 11:49am by weaklemondrink

Login or Register to Post