I'm trying to get the yellow div to slide up when clicking on the tree icon in the modal possibly without jQuery but I can't get it to work.
You can see the page I'm building here by clicking the first icon from left https://vivere-albero-verona.netlify.app/
I've tried different solutions but here's the code I have right now
html:
<div id="alberi" class="alberi">
<div id="acero">
<img src="./images/tree.png">
<h1>ACERO CAMPESTRE</h1>
<h2>Altezza: 7,0m</h2>
<h2>Ingombro: 2,0m</h2>
<h2>Fornitore</h2>
</div>
</div>
css:
.alberi{
background-color: green;
display: flex;
height: 0px;
width: 90.9%;
position: absolute;
bottom: 0;
border-bottom-left-radius: 30px;
}
.slided{
height: 270px;}
js:
const sezionealberi = document.querySelector('#alberi')
const pulsantealberi = document.querySelector('#m-tree')
pulsantealberi.addEventListener('click', primavera)
let mezzastagione = 1;
function primavera()
{
if(mezzastagione == 1)
{
sezionealberi.innerHTML = `<class = "alberi slided">`;
mezzastagione = 0;
}
else{
sezionealberi.innerHTML = `<class = "alberi">`;
mezzastagione = 1;
}
}