0
I created a Collapse but I’m not getting it to push the Divs down, thus getting superimposed on the content.
I tried some code in CSS but it’s not working.
HTML:
<div id="collapsible-menu">
<button type="button" class="collapsible"><img src="/img/header/earth-grid-symbol.png" alt="Menu Linguagem"></button>
<div class="content">
<img src="img/header/earth.png">
<img src="img/header/br.png">
</div>
JAVASCRIPT:
var i;
for (i = 0; i < coll.length; i++) {
coll[i].addEventListener("click", function() {
this.classList.toggle("active");
var content = this.nextElementSibling;
if (content.style.maxHeight){
content.style.maxHeight = null;
} else {
content.style.maxHeight = content.scrollHeight + "px";
}
});
}
CSS:
display: flex;
flex-direction: column;
border: 2px solid #f0db00;
}
button.collapsible {
cursor: pointer;
border: none;
text-align: left;
outline: none;
background-color: transparent;
}
.content{
border: 2px solid #f0db00;
margin-left: -250px;
padding: 0 18px;
background-color: white;
max-height: 0;
overflow: hidden;
transition: max-height 0.2s ease-out;
}
mount a verifiable example that shows the problem, only looked at the code becomes difficult to understand
– Ricardo Pontual
In the test it works. However if you look at the test page it does not give space in the div.
– Renan Ranzani
https://jsfiddle.net/renanranzani/a6dkcpu0/21/ -Test http://www.siteesquadros.kinghost.net/ - Page
– Renan Ranzani
try for example here on the site, it supports scripts the way jsfiddle does
– Ricardo Pontual