如何使选择的下拉列表高于所有其他元素

时间:2021-11-04 15:53:41

HTML:

<div style="overflow: auto; position: relative; z-index: 99999999 ! important;" class="content">
    <h4>Filter</h4>
    <div style="overflow: visible; width: 100%; padding: 0 0 3% 0;">
        <!-- the DDL is here -->
    </div>
</div>

CSS:

  /* ----------- */
  .content {
      background: #FFF;
      border-top: 2px solid #00539B;
      padding: 2em;
      min-height: 115px;
      /*height: 220px;*/
  }

  .content h2,
    .content h3,
    .content h4,
    .content p {
      margin: 0 0 15px 0;
      color: #00539B;
  } 

How can I modify the style in my page or the chosen CSS/JQuery to make it appear outside and over every other DIV on the page.

如何修改我的页面或所选CSS / JQuery中的样式,使其显示在页面外的所有其他DIV之外。

1 个解决方案

#1


0  

You should do some DOM manipulation:

你应该做一些DOM操作:

$('#child').css({
  left:10,
  top:25
}).appendTo(document.body);
div{width:300px; height:150px; overflow:hidden; background:red;}
#child{width:150px; height:250px; overflow:hidden; background:yellow; left:20px; top:50px; position:absolute;}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div>
  Parent
  <div id='child'>Child</div>
</div>


The elements appears at the closing of body they can be shown on top of every other elements.

元素出现在身体的闭合处,它们可以显示在每个其他元素的顶部。

#1


0  

You should do some DOM manipulation:

你应该做一些DOM操作:

$('#child').css({
  left:10,
  top:25
}).appendTo(document.body);
div{width:300px; height:150px; overflow:hidden; background:red;}
#child{width:150px; height:250px; overflow:hidden; background:yellow; left:20px; top:50px; position:absolute;}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div>
  Parent
  <div id='child'>Child</div>
</div>


The elements appears at the closing of body they can be shown on top of every other elements.

元素出现在身体的闭合处,它们可以显示在每个其他元素的顶部。