Bootstrap模态问题

时间:2016-01-18 21:49:43

标签: html twitter-bootstrap twitter-bootstrap-3

我这里有2个引导模态。一个用于发送消息,另一个用于共享。每个模态由不同的链接元素触发。问题是,一次只能使用一种模态。因此,如果我删除第一个,第二个开始显示。有人可以帮助解决这里发生的事情吗?

这是代码

 <!-- SHARE Modal -->

<!-- Modal -->
<div id="shareModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        
        <!-- modal header content -->
        	<div class="row"> 
            	<div class="col-sm-2"> <img class="" src="images/poster-image - Modal.jpg"/> </div><!-- /col-sm- 1 -->
                
                <div class="col-sm-10"> <h4 class="modal-title txt-highlighted">Share this post</h4> </div><!-- /col-sm-11 -->
            </div><!-- end row-->
        <!-- /modal header content -->
      </div>
      <div class="modal-body">
        <!--Modal body Content -->
        	<div class="row"> 
            	<div class="col-sm-9">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum 
has been the industry's  standard dummy text ever since the 1500s, when an unknown 
printer took a galley of type and scrambled it to make a type specimen book. </div>

			<!-- modal pic -->
            <div class="col-sm-3 " style="padding-left:7%;"><span class="img-product-modal-frame"><img src="images/img-product.jpg"/> </span> </div>
            <!-- modal pic -->
            </div>
        <!-- Modal body Content -->
      </div>
      <div class="modal-footer">
      <!-- Modal Footer content -->
      <div class="row">
       <!-- footer left section -->
      	<div class="col-sm-10"> 
        	<div class="col-sm-2 text-left no-padd-left"> Share on my </div>
            <div class="col-sm-2"> 
        	<div class="checkbox-inline"> <input type="checkbox" class="modal-checkbox "/><img src="images/fb-grey.gif"/></span></div></div><!-- col-sm-2-->
            <div class="col-sm-2"> 
        	<div class="checkbox-inline"> <input type="checkbox"/> <img src="images/twitter-grey.gif"/></div></div><!-- col-sm-2-->
            <div class="col-sm-2"> 
        	<div class="checkbox-inline"> <input type="checkbox"/> <img src="images/linkedin-grey.gif"/></div></div><!-- col-sm-2-->
        
        </div><!--/footer left section -->
        
        <div class="col-sm-2"><button type="button" class="btn btn-default" data-dismiss="modal">Share</button> </div><!-- footer right section -->
      </div>
      <!-- /Modal Footer content -->
      
        
      </div>
    </div>

  

<!-- /SHARE MODAL -->


<!-- MESSAGE ME MODAL -->
	<div id="messageModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <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">
        <p>Some text in the modal.</p>
      </div>
      <div class="modal-footer">
        Close
      </div>
    </div>

  </div>
</div>
<!-- /MESSAGE ME MODAL -->

1 个答案:

答案 0 :(得分:1)

您的共享模式在其合成中包含不正确的闭包标记。

你能试试吗?

<!-- SHARE Modal -->

<!-- Modal -->
<div id="shareModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>

        <!-- modal header content -->
        <div class="row"> 
          <div class="col-sm-2"> <img class="" src="images/poster-image - Modal.jpg"/> </div><!-- /col-sm- 1 -->

          <div class="col-sm-10"> <h4 class="modal-title txt-highlighted">Share this post</h4> </div><!-- /col-sm-11 -->
          </div><!-- end row-->
        <!-- /modal header content -->
      </div>
    <div class="modal-body">
    <!--Modal body Content -->
      <div class="row"> 
        <div class="col-sm-9">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's  standard dummy text ever since the 1500s, when an unknown 
printer took a galley of type and scrambled it to make a type specimen book. 
        </div>

        <!-- modal pic -->
        <div class="col-sm-3 " style="padding-left:7%;"><span class="img-product-modal-frame"><img src="images/img-product.jpg"/> </span> 
        </div>
      <!-- modal pic -->
      </div>
        <!-- Modal body Content -->
      </div>
      <div class="modal-footer">
        <!-- Modal Footer content -->
        <div class="row">
       <!-- footer left section -->
          <div class="col-sm-10"> 
            <div class="col-sm-2 text-left no-padd-left"> 
              Share on my 
            </div>
            <div class="col-sm-2"> 
              <div class="checkbox-inline"> 
                <input type="checkbox" class="modal-checkbox "/><img src="images/fb-grey.gif"/>
              </div>
            </div><!-- col-sm-2-->
            <div class="col-sm-2"> 
              <div class="checkbox-inline"> 
                <input type="checkbox"/> <img src="images/twitter-grey.gif"/>
              </div>
            </div><!-- col-sm-2-->
              <div class="col-sm-2"> 
                <div class="checkbox-inline"> 
                  <input type="checkbox"/> <img src="images/linkedin-grey.gif"/>
                </div>
              </div><!-- col-sm-2-->

        </div><!--/footer left section -->

        <div class="col-sm-2"><button type="button" class="btn btn-default" data-dismiss="modal">Share</button> </div><!-- footer right section -->
      </div>
      <!-- /Modal Footer content -->
      </div>
    </div>
  </div>
</div>

<!-- /SHARE MODAL -->

而不是您原来的共享模式?