Wei Jiang's Weblog

如何在自己的Joomla组件中弹出一个模式(modal)窗口

Posted by: thedean515 on: July 13, 2009

前面的文章中,曾经提到过在扩展组件中如何弹出窗口,但是popupwindow弹出的窗口不是模式的,研究了一下后台界面发文章界面的上传图片,终于搞清楚了,最关键的JS在 /media/system/js/modal.js 。有以下两种方式都可以实现,修改的都是扩展组件的模板文件default.php.

方式一:

<a rel="{handler: 'iframe', size: {x: 570, y: 400}}"
href="/index.php" class="modal">view</a>

就这么简单就可以实现了,其余的东西joomla!全部帮你处理了。高兴吧!

方式二:

<a id="aatest">view</a>
 function f() {
  SqueezeBox.fromElement(null, {handler: 'iframe', size: {x: 570, y: 400}, href:'/index.php'});
 };

一般还是使用第一种好了,如果你要研究modal.js到底怎么实现的,第二种方式使一个入门的例子。
引:http://www.maycode.com/index.php/hotspot/39-joomla-inspect/376-joomla-mootools.html

Leave a Reply

Archives

Calendar

July 2009
M T W T F S S
« Feb    
 12345
6789101112
13141516171819
20212223242526
2728293031  

How to include \LaTeX Code

To include code in your post, use the following: $latex your-latex-code-here$ So, for example, $latex i\hbar\frac{\partial}{\partial t}\left|\Psi(t)\right>=H\left|\Psi(t)\right>$

Recent Comments

Blog Stats

  • 240 hits