html 让Joomla Modal Popup响应

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html 让Joomla Modal Popup响应相关的知识,希望对你有一定的参考价值。

<!-- Make the Joomla Modal Popup Responsive -->

<!-- 1. Import following library at the start of the page. -->

<?php JHTML::_('behavior.modal', 'a.modal'); ?>

<!-- This ensures that the modal.js script and the modal.css style sheets are loaded, plus the mootools javascript framework which the script requires, and initialises the modal window. Note that from Joomla 3.3x onwards using JQuery might be a better idea. -->

<!-- 2. Add following function in javascript -->

<script>
$(document).ready(function() {
    var width = $(window).width();
    var height = $(window).height();
 
    //ID of container
    $('a#modal_info').attr('rel','{handler: "iframe", size: {x: '+(width-(width*0.10))+', y: '+(height-(height*0.10))+'}}');
});
</script>

<!-- If we give modal size directly in html then it will not make modal popup responsive. So for that we have used javascript to give size to the modal.
To give size to the popup window, first we dynamically calculated window size and gave that size to the modal window so this can make our modal popup responsive.
3. Now you need to invoke the modal in your html with the code below.  Give same id to the javascript and container. -->

<a id="modal_info" href="#" class="modal">link</a>

<!-- To create a popup you simply give the css class 'modal' to the link <a> tag which links to the content you want to display just like you would normally do ! -->

以上是关于html 让Joomla Modal Popup响应的主要内容,如果未能解决你的问题,请参考以下文章

html Bootstrap Modal - Popup - Google Maps

css jQuery Simple Modal Popup

QML Popup Overlay.modal 过渡不起作用

bootstrap modal popup c# codebehind

Ajax 没有在 Modal Popup 中触发

Dismiss Modal ViewController Popup