Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 单击外部时Twiiter引导模式未关闭_Javascript_Jquery_Css_Twitter Bootstrap - Fatal编程技术网

Javascript 单击外部时Twiiter引导模式未关闭

Javascript 单击外部时Twiiter引导模式未关闭,javascript,jquery,css,twitter-bootstrap,Javascript,Jquery,Css,Twitter Bootstrap,嗨,我在使用bootstrap中的代理主题,但我自定义了它的大小,但当在它外面单击时,它不会关闭,甚至bootstrap中的正常模式也不会关闭,(有时关闭,有时关闭,有时关闭注释)我会在下面显示我的引导模式: <p class="buttonp "> <a href="#portfolioModal" class="portfolio-link" data-toggle="modal" data-dismiss="modal"> Click fo

嗨,我在使用bootstrap中的代理主题,但我自定义了它的大小,但当在它外面单击时,它不会关闭,甚至bootstrap中的正常模式也不会关闭,(有时关闭,有时关闭,有时关闭注释)我会在下面显示我的引导模式:

          <p class="buttonp ">    <a href="#portfolioModal" class="portfolio-link" data-toggle="modal" data-dismiss="modal">
Click for more info </a></p>               
</div>

                               <!-- Portfolio Modal 1 -->
                        <div id="portfolioModal" class="modal fade portfolio-modal"   tabindex="-1" role="dialog" aria-labelledby="portfolioModal"  aria-hidden="true">
                            <div class="modal-content">
                               <!-- <div class="close-modal" data-dismiss="modal">
                                    <div class="lr">
                                        <div class="rl">
                                        </div>
                                    </div>
                                </div> -->
                                <div class="container">
                                    <div class="row">
                                        <div class="col-md-5">
                                            <div class="modal-body">
                                                <!-- Project Details Go Here -->
                                                <p> Lorem ipsum dolor sit amet, consectetur adip iscing elit. Suspendisse laoreet est nunc. Na </p>
                                                                                  <p> Lorem ipsum dolor sit amet, consectetur adip iscing elit. Suspendisse laoreet est nunc. Na </p>
              </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!-- -->    

我是一位杰出的艺术家。拉奥里特公寓。Na

我是一位杰出的艺术家。拉奥里特公寓。Na


您的代码存在以下问题:

  • 您已经将模态代码放在其他一些元素中,而不是按照上的指令直接放在主体中
  • 您已经调整了模态体和模态内容的大小,因此它占据了整个屏幕。模态有一个占据整个屏幕的层(模态背景类),在它上面显示模态。此模态背景类在收到单击时关闭模态,但现在无法关闭,因为模态对话框已覆盖它
  • 我想你可能想覆盖一些元素。看看

    
    同一天,你可以坐同一天,也可以坐同一天,也可以坐同一天,也可以坐同一天,也可以坐同一天,也可以坐同一天,也可以坐同一天,也可以坐同一天,也可以坐同一天
    花,植物,药草,树木,花,植物,药草,树木,花,植物,药草,树木,花,植物,药草,树木,
    .家长{
    背景:绿色;
    位置:固定;
    }
    .内容{
    背景:蓝色;
    宽度:100px;
    }
    .覆盖{
    位置:绝对位置;
    背景:红色;
    排名:0;
    底部:0;
    左:0;
    右:0;
    }
    
    模式代码正常。你能不能把完整的代码示例发布在或其他前端测试站点上?“我想还有别的东西在妨碍我们的接近。”@zveljkovic嘿!检查:)谢谢!及其引导程序
    <div class="parent">
      <div class="content">Lorem ipsum dolor sit ametLorem ipsum dolor sit ametLorem ipsum dolor sit ametLorem ipsum dolor sit ametLorem ipsum dolor sit ametLorem ipsum dolor sit ametLorem ipsum dolor sit amet</div>
      <div class="overlay">Flower, Plants, Herbs, Trees.,Flower, Plants, Herbs, Trees,Flower, Plants, Herbs, Trees,Flower, Plants, Herbs, Trees,</div>
    </div>
    .parent{
      background:green;
      position: fixed;
    }
    
    .content{
      background: blue;
      width: 100px;
    }
    
    .overlay{
      position:absolute;
      background: red;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
    }