为了账号安全,请及时绑定邮箱和手机立即绑定

为什么遮罩层会覆盖吊我弹出框 我无法选择

http://img1.sycdn.imooc.com//576d421000016eea13740616.jpg

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>无标题文档</title>

<!-- 链接bootstrap.min -->

<link href="bootstrap/bootstrap-3.3.5/dist/css/bootstrap.min.css" rel="stylesheet" type="text/css">


<style type="text/css">

#nav{ 

position:fixed;

}

.navbar-logo{ 

  background:no-repeat url(img/logo.jpg) center center; 

display:block; 

width:96px;

height:50px;

}

.shop{ 

  line-height:50px; 

cursor:pointer;

color:#999;

margin:0px 20px;

}

.shop:hover{

color:#333;

}

.user{ 

  line-height:50px; 

cursor:pointer;

color:#999;

margin:0px 20px;

}

.user:hover{

color:#333;

}

.link{

margin-top:56px;

}

.thumbnail{

background:#CCC;

border:#333 2px solid; 

height:360px;

}

.main{

margin-top:80px;

}


</style>

</head>


<body>


<!-- 导航 -->


<nav class="navbar navbar-default navbar-fixed-top" id="nav">

      <div class="container">

      <div class="container-fluid">

        <!-- Brand and toggle get grouped for better mobile display -->

        <div class="navbar-header">

          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">

            <span class="sr-only">Toggle navigation</span>

            <span class="icon-bar"></span>

            <span class="icon-bar"></span>

            <span class="icon-bar"></span>

          </button>

          <a class="navbar-logo" href="#"></a>

        </div>

    

        <!-- Collect the nav links, forms, and other content for toggling -->

        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">

          <ul class="nav navbar-nav">

            <li><a href="#">我要开店</a></li> 

            

            <!-- 商品模态 -->

               <li>

               <button class="btn btn-primary" type="button">点击我</button>

<div class="modal fade" id="mymodal">

    <div class="modal-dialog">

        <div class="modal-content">

            <div class="modal-header">

<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>

<h4 class="modal-title">模态弹出窗标题</h4>

</div>

<div class="modal-body">

<p>模态弹出窗主体内容</p>

</div>

<div class="modal-footer">

<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>

<button type="button" class="btn btn-primary">保存</button>

</div>

</div><!-- /.modal-content -->

</div><!-- /.modal-dialog -->

</div><!-- /.modal -->

        </li>  

           </li>

          </ul>

      

          <ul class="nav navbar-nav navbar-right">

                <form class="navbar-form navbar-left" role="search">

            <div class="form-group">

              <input type="text" class="form-control" placeholder="搜索商品">

            </div>

            <button type="submit" class="btn btn-default">搜索</button>

          </form>

            <li class="user"> 账号 <span class="glyphicon glyphicon-user"></li>

            

            

            <li class="shop">购物车 <span class="glyphicon glyphicon-shopping-cart"></span></li>

          

         </ul>

        </div><!-- /.navbar-collapse -->


      </div><!-- /.container-fluid -->

    

    </div><!-- /.container -->

   

   </nav>

 <!--内容-->


<div class="link">

  <div class="container">

    <ol class="breadcrumb">

      <li><a href="#">我的亚马逊</a></li>

      <li><a href="#">Z秒杀</a></li>

     <li><a href="#">礼品卡</a></li>

     <li><a href="#">海外购</a></li>

     <li><a href="#">帮助</a></li>

     <li><a href="#">IN ENGLISH</a></li>

</ol>

 </div>

 </div>

 

 

 <!--banner-->

 


 <div id="myCarousel" class="carousel slide">

   <!-- 轮播(Carousel)指标 -->

   <ol class="carousel-indicators">

      <li data-target="#myCarousel" data-slide-to="0" class="active"></li>

      <li data-target="#myCarousel" data-slide-to="1"></li>

      <li data-target="#myCarousel" data-slide-to="2">

        <div id="myCarousel2" class="carousel slide">

          <!-- 轮播(Carousel)指标 -->

          <ol class="carousel-indicators">

            <li data-target="#myCarousel" data-slide-to="0" class="active"></li>

            <li data-target="#myCarousel" data-slide-to="1"></li>

            <li data-target="#myCarousel" data-slide-to="2"></li>

          </ol>

          <!-- 轮播(Carousel)项目 -->

          <div class="carousel-inner">

            <div class="item active"> <img src="../淘宝banner/bannertop.jpg" alt="First slide"> </div>

            <div class="item"> <img src="../淘宝banner/banner.jpg" alt="Second slide"> </div>

            <div class="item"> <img src="../淘宝banner/清凉一夏.jpg" alt="Third slide"> </div>

          </div>

          <!-- 轮播(Carousel)导航 -->

          <a class="carousel-control left" href="#myCarousel" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left"></span></a> <a class="carousel-control right" href="#myCarousel" data-slide="next"> <span class="glyphicon glyphicon-chevron-right"></span></a> </div>

      </li>

   </ol>   

   <!-- 轮播(Carousel)项目 -->

   <div class="carousel-inner">

      <div class="item active">

         <img src="../淘宝banner/bannertop.jpg" alt="First slide">

      </div>

      <div class="item">

         <img src="../淘宝banner/banner.jpg" alt="Second slide">

      </div>

      <div class="item">

         <img src="../淘宝banner/清凉一夏.jpg" alt="Third slide">

      </div>

   </div>

   <!-- 轮播(Carousel)导航 -->

      

      <a class="carousel-control left" href="#myCarousel" data-slide="prev">

      <span class="glyphicon glyphicon-chevron-left"></span></a>

    <a class="carousel-control right" href="#myCarousel" data-slide="next">

    <span class="glyphicon glyphicon-chevron-right"></span></a>

</div> 

<script type="text/javascript" src="bootstrap/bootstrap-3.3.5/js/jquery-3.0.0.min.js"></script>

<script type="text/javascript" src="bootstrap/bootstrap-3.3.5/dist/js/bootstrap.min.js"></script>

<script type="text/javascript" src="bootstrap/bootstrap-3.3.5/js/transition.js"></script>

<script type="text/javascript" src="bootstrap/bootstrap-3.3.5/js/modal.js"></script>


<script>

  $(function(){

    $(".btn").click(function(){

      $("#mymodal").modal("toggle");

    });

  });

</script>

</body>

</html>


正在回答

2 回答

厉害了提携


0 回复 有任何疑惑可以回复我~

由于li里面的空间不足,所以弹窗div撑不开以导致这种现象,所以可以把

<div class="modal fade" id="mymodal">

    <div class="modal-dialog">

        <div class="modal-content">

            <div class="modal-header">

<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>

<h4 class="modal-title">模态弹出窗标题</h4>

</div>

<div class="modal-body">

<p>模态弹出窗主体内容</p>

</div>

<div class="modal-footer">

<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>

<button type="button" class="btn btn-primary">保存</button>

</div>

</div><!-- /.modal-content -->

</div><!-- /.modal-dialog -->

</div><!-- /.modal -->

这一整段代码独自放到最后的div后面即可

1 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

为什么遮罩层会覆盖吊我弹出框 我无法选择

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信