1
positions an element using the reference of the position of the div box, the element is on display None and when it receives the click event it appears on the screen, however it should appear below the div box.
<h3> Sindico<i class="taskAtiv glyphicon glyphicon-chevron-down">
</i>
</h3>
<div class="box row col-sm-2 box-white">
<p class="task">Descrição</p>
<br />
<p class="task">Descrição</p>
<br />
<p class="task">Descrição</p>
<br />
</div>
css
.box {
width: 200px;
font: 8px;
padding: 5px;
margin: 5px;
border: 1px solid #ccc;
display: none;
position: absolute;
z-index: 9999999999999999;
top: 54%;
}
.task {
cursor: pointer;
padding-left: 5px;
margin-bottom: 0px;
border-bottom: 1px solid #ccc;
}
Javascript
$(".taskAtiv ").on("click", function () {
$(this).toggleClass("glyphicon-chevron-down").toggleClass("glyphicon-chevron-up");
});
you want div to appear under "sindico"? or it’s the other way around?
– nunks
yes, below the union
– Marcelo Batista
I don’t understand. How an element will receive a click if it is in
display: none
? There’s something wrong with your question.– Sam
only now I understood that it was for one element to be under the other, in the sense
z-index
of the thing, hahah... deleting my answer– nunks