Auto load Modal SqueezeBox in Joomla

11.05.2009

I needed to load a modal pop-up on page load for a Joomla component I am working on. It's actually pretty easy to do. The code is below. This is developing in the Joomla 1.5 framework using the core MooTools 1.1 and SqueezeBox 1.0.

if( $params->get('show_disclaimer') == 1 ){

$js = 'window.addEvent('domready',
function(){SqueezeBox.setContent('iframe',\'http://zunostudios.com\')});';

JHTML::_('behavior.mootools');
JHTML::_('behavior.modal');
$doc->addScriptDeclaration($js);

}