简体   繁体   English

如何使用不同的网址创建模式弹出窗口

[英]How to create a Modal Popup with different url

I'm trying to think how to create a Modal Popup Window that loads an HTML page and also with different URL for each popup. 我正在尝试思考如何创建一个模式弹出窗口,该窗口可以加载HTML页面,并且每个弹出窗口都具有不同的URL。

This is an example 这是一个例子

You can see that it is like a modal window with its own URL. 您会看到它就像一个带有自己的URL的模式窗口。 Do you have any ideas? 你有什么想法? I have to create exactly the same thing as the example. 我必须创建与示例完全相同的东西。

I tried with something like this: 我尝试过这样的事情:

<script type="text/javascript">

    var style = "top=center, left=center, width=500, height=500, status=no, menubar=no, toolbar=no, scrollbars=no, resize=no";

    function Popup(url) {
        window.open(url, "", style);
    }
</script>

But I don't know how to get out about the URL thing. 但是我不知道如何了解URL。

Sorry for english ;) 对不起英语;)

I think what you might be referring to is showModalDialog() function. 我认为您可能要指的是showModalDialog()函数。 Open() would just open the url in a new tab or window. Open()只会在新标签页或窗口中打开网址。

var style = "top=center, left=center, width=500, height=500, status=no, menubar=no, toolbar=no, scrollbars=no, resize=no";
function Popup(url) {
        window.showModalDialog(url, "", style )
    }

It's a very old approach. 这是一个非常古老的方法。 In order to get the modal layout closer to what you want, you can either use bootstrap modal popup http://www.w3schools.com/bootstrap/bootstrap_modal.asp or jquery modal popup https://jqueryui.com/dialog/ . 为了使模态布局更接近您想要的布局,您可以使用bootstrap modal popup http://www.w3schools.com/bootstrap/bootstrap_modal.aspjquery modal popup https://jqueryui.com/dialog/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM