27 July 2009
[Click to cite this article]
[hide academic citations]
AMA citation:
[no last name] [no initial]. An example of design a Popup Window in Joomla!. Stone Studio. 2009. Available at: http://wei-jiang.com/programming/an-example-of-design-a-popup-window-in-joomla. Accessed March 11, 2010.
APA citation:
[no last name], [no first name]. (2009). An example of design a Popup Window in Joomla!. Retrieved March 11, 2010, from Stone Studio Web site, http://wei-jiang.com/programming/an-example-of-design-a-popup-window-in-joomla
Chicago citation:
[no last name], [no first name], "An example of design a Popup Window in Joomla!", Stone Studio, posted July 27, 2009, http://wei-jiang.com/programming/an-example-of-design-a-popup-window-in-joomla (accessed March 11, 2010).
Harvard citation:
[no last name], [no initial] 2009, An example of design a Popup Window in Joomla!, Stone Studio. Retrieved March 11, 2010, from <http://wei-jiang.com/programming/an-example-of-design-a-popup-window-in-joomla>
MLA citation:
[no last name], [no first name]. "An example of design a Popup Window in Joomla!." Stone Studio. 27 Jul. 2009. 11 Mar. 2010 <http://wei-jiang.com/programming/an-example-of-design-a-popup-window-in-joomla>
Thank you for your interest.
写一个用于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
| function modalBox () {
$params = array(
'size' => ; array(
'x' => ; 350,
'y' => ; 100
)
);
JHTML ::_ ('behavior.modal', 'a.popup',$params); |
用这个我们就可以控制弹出窗口的大小了。