Thursday, 29 October 2009 09:34
As part of a recent project, I needed to open a modal window using Javascript. Here's how I did it.
First, I made sure the modal behavior was loaded:
JHTML::_('behavior.modal');
Then, in my Javascript, I created a new element to house all of my dynamic content (this could also be a hidden div, if needed). Once I had that, all I had to do was pass the MooTools reference of that object to SqueezeBox, and open.
var newElem = new Element( 'div' ).setText( 'demo' ); SqueezeBox.setContent( 'adopt', newElem );
Now, had I wanted to open an external resource with an iframe handler, I could use the following:
SqueezeBox.setContent( 'iframe', 'http://jeffchannell.com' );
Last Updated on Monday, 07 December 2009 12:44
Comments (2)
Add your comment
Latest Articles
Most Popular
The Joomla!® name is used under a limited license from Open Source Matters in the United States and other countries. Jeff Channell is not affiliated with or endorsed by Open Source Matters or the Joomla!® Project.



Simple and working