how to force one dialog box to stay above the other?

1

I have 1 dialog box that calls a 2, but this 2 needs to be above 1 how do I force it via javascript? or any other way, less z-index than tried and is not going.

    
asked by anonymous 06.07.2017 / 14:37

1 answer

0

As you did not post some code or something like that I made an example with divs, if my example did not serve edit the question, and comment below so I can modify it so I can help you better.

$(function(){
  $('#mostrarDiv').click(function(){
    $('.div2').show(250);
  });
  $('#ocultarDiv').click(function(){
    $('.div2').hide(250);
  });
});
.div1{
  position: absolute;
  top: 0;
  left: 0;
  width: 200px;
  height: 200px;
  background: green;
}

.div2{
  display:none;
  position: absolute;
  top: 30;
  left: 30;
  z-index: 5;
  width: 200px;
  height: 200px;
  background: red;
}

#mostrarDiv{
  position: absolute;
  top: 300px;
}

#ocultarDiv{
  position: absolute;
  top: 300px;
  left: 130px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><divclass="div1"></div>
<div class="div2"></div>
<br>
<input type="button" id="mostrarDiv" value="Chamar div 2">
<input type="button" id="ocultarDiv" value="Ocultar div 2">
    
06.07.2017 / 20:16