繁体   English   中英

我如何使用bootstrap 3 modal打开自己?

[英]How can I use bootstrap 3 modal to open self?

我正在为项目使用bootstrap 3。

<div data-target="#bs_id" data-toggle="modal" class="carousel-content" id="bs_id">

<div> There is a lot of  content here </div>
<div> I like to show all of the content in a modal window </div>

</div>

我要做的是单击ID为“ bs_id”的div,并在模式窗口中显示其所有内容。 我不知道如何引用自己,因此将不胜感激任何帮助,尤其是动态帮助(使用jQuery的.on),

谢谢,

M @ KM

您已将id和data-ref放在同一标签中,它应将id引用到div。 因此,使这样的结构可以正常工作。

<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
  Launch demo modal
</button>

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">

</div>
 <div data-target="#bs_id" data-toggle="modal" class="carousel-content" >
      <div class="content_wrapper modal fade" id="bs_id" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div> There is a lot of  content here </div>
        <div> I like to show all of the content in a modal window </div>
       </div>    
     </div>

暂无
暂无

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

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