简体   繁体   English

将代码嵌入弹出窗口或模式框中

[英]Embed Code in Popup or modal box

I have come across one issue for getting an embedded link in modal box so that embed code can be shared to any one to use in their websites. 我遇到了一个在模态框中获取嵌入式链接的问题,以便可以将嵌入代码共享给任何人以在其网站中使用。

I have tried to some extent to get the popup when I click a button and open the embed link content in the popup. 单击按钮并在弹出窗口中打开嵌入链接内容时,我在某种程度上尝试了弹出窗口。

But the lines to be shared to the user will be more. 但是要共享给用户的行会更多。 So, looking for simple way to acheive it. 因此,寻找实现这一目标的简单方法。

`<div class="container">
<h2>Click on the link below</h2>
<!-- Trigger the modal with a button -->
<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Reserve Table</button>
<!-- Modal -->
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Modal Header</h4>
</div>
<div class="modal-body">
<embed width="800" height="685" src="http://find-out-pro.co/pcktnight/projet1/reservations_website.html?member_id=56&langs=all&place=101" frameborder="0" allowfullscreen="true">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>`

You could try using <iframe> instead of embed 您可以尝试使用<iframe>而不是embed

I've made a JSFiddle to show you: 我制作了一个JSFiddle给您看:

<div class="modal-body">
    <iframe id="videoContainer" width="800" height="685" src="http://find-out-pro.co/pcktnight/projet1/reservations_website.html?member_id=56&langs=all&place=101" frameborder="0" allowfullscreen></iframe>
</div>

JSFIDDLE EXAMPLE JSFIDDLE示例

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

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