I dont want all button to show at once, i should be like drop down transition. I want each button to show 1 by 1, by expanding the main div and inside button should showed in a expanding transition. I tried many thing but can't get it to work any css expers whelp
var t = document.getElementsByClassName('temp')
const arr = [...t]
document.getElementById('main').onmouseover = () => {
arr.forEach((a) => {
a.style.display = 'inline';
})
}
document.getElementById('main').onmouseout = () => {
arr.forEach((a) => {
a.style.display = 'none';
})
}
// t.onmouseover = () =>{
// console.log('hi')
// // document.getElementsByClassName('temp')
// }
/* *{
background-color : black;
} */
#main:hover {
box-shadow: 0px 15px 20px rgba(46, 229, 157, 0.4);
/* color : #fff; */
transform: translateY(-7px);
transition: all 0.5s;
/* display : block; */
/* position : absolute; */
}
.temp {
display: none;
position: relative;
}
#main {
background-color: #2EE59D;
}
<div id="main">
<button id='button'>hello</button>
<button class='temp'>button 1</button>
<button class='temp'>button 2</button>
<button class='temp'>button 3</button>
<button class='temp'>button 4</button>
<button class='temp'>button 5</button>
</div>
this only show the button directed not like i expect