Bootstrap 3 添加外部页面到弹出窗口Bootstrap 3 with remote Modal

本文详细介绍了如何使用jQuery的load方法从提供的远程URL加载内容,并将其注入到模态窗口的根元素中。通过一个具体的示例,展示了如何创建一个带有模态功能的网页元素,以及如何在点击特定链接时触发模态窗口的显示,同时加载并展示来自外部页面的内容。此外,提供了官方文档链接和中文说明,以便进一步深入学习和实践。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

If a remote URL is provided, content will be loaded via jQuery’s load method and injected into the root of the modal element.

<a data-toggle="modal" href="to-another-url-page" data-target="#myModal">Click me !</a>

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                 <h4 class="modal-title">Modal title</h4>

            </div>
            <div class="modal-body"><div class="te"></div></div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                <button type="button" class="btn btn-primary">Save changes</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->

 

DEMO

 

当然,最详细的文档在这里:http://getbootstrap.com/javascript/#modals

Modals中文说明:http://www.w3schools.com/bootstrap/bootstrap_modal.asp

原文:Bootstrap 3 添加外部页面到弹出窗口Bootstrap 3 with remote Modal

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值