引:http://www.maycode.com/index.php/hotspot/39-joomla-inspect/376-joomla-mootools.html

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

方式一:

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

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

方式二:

<script src="/media/system/js/modal.js"></script>
<link rel="stylesheet" href="/media/system/css/modal.css" type="text/css" />

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

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

相关文章:

  • 2021-12-09
  • 2021-10-07
  • 2021-06-04
  • 2022-03-08
  • 2021-05-27
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-23
  • 2021-05-31
  • 2021-10-10
  • 2021-06-28
  • 2021-07-28
  • 2021-11-01
相关资源
相似解决方案