Home > php教程 > php手册 > body text

Joomla实现组件中弹出一个模式(modal)窗口的方法,joomlamodal

WBOY
Release: 2016-06-13 08:40:38
Original
1239 people have browsed it

Joomla实现组件中弹出一个模式(modal)窗口的方法,joomlamodal

本文实例讲述了Joomla实现组件中弹出一个模式(modal)窗口的方法。分享给大家供大家参考,具体如下:

最关键的JS在 /media/system/js/modal.js 。有以下两种方式都可以实现,修改的都是扩展组件的模板文件default.php.

方式一:

<&#63;php JHTML::_('behavior.modal', 'a.modal');&#63;>
<a rel="{handler: 'iframe', size: {x: 570, y: 400}}" href="/index.php" class="modal">view</a>

Copy after login

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

方式二:

<script src="/media/system/js/modal.js"></script>
<link rel="stylesheet" href="/media/system/css/modal.css" type="text/css" />
<a id="aatest" onclick="f()">view</a>
<script>
 function f() {
   SqueezeBox.fromElement(null, {handler: 'iframe', size: {x: 570, y: 400}, href:'/index.php'});
};
</script>

Copy after login

一般还是使用第一种好了,如果你要研究modal.js到底怎么实现的,第二种方式使一个入门的例子。

更多关于joomla相关内容感兴趣的读者可查看本站专题:《Yii框架入门及常用技巧总结》、《php优秀开发框架总结》、《smarty模板入门基础教程》、《ThinkPHP常用方法总结》、《php面向对象程序设计入门教程》、《php字符串(string)用法总结》、《php+mysql数据库操作入门教程》及《php常见数据库操作技巧汇总》

希望本文所述对大家基于joomla程序设计有所帮助。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!