An example of design a Popup Window in Joomla!
Welcome to Stone Studio!
写一个用于Joomla里的(超级简单的)pop up window程序。
Like the “lightbox” effect
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | defined( '_JEXEC' ) or die( 'Restricted access' ); jimport('joomla.application.component.controller'); class JsController extends JController { function modalBox() { JHTML::_('behavior.modal', 'a.popup'); ?> <a class="popup" href="index.php?option=com_js&task=insideModal&format=raw">Read the daily menu.</a> } function insideModal() { ?> <h1>Today's Menu</h1> <ul> <li>Crispy chicken nuggets with ginger dressing</li> <li>Swordfish in bean curd sauce</li> <li>Stir-fried vegetables over white rice</li> </ul> } } $controller = new JsController(); $controller->execute(JRequest::getCmd('task')); |
Let’s try it by going to:
/index.php?option=com_js&task=modalBox


如果我们修改一下 modalBox function,
1 2 3 4 5 6 7 8 9 10 |
用这个我们就可以控制弹出窗口的大小了。

