<div class="modalmenu" >
<div class="modal_itm" (mouseenter)="sepin(sepinout)" (mouseleave)="sepout(sepinout)"><a href="#in">HOME</a></div>
<div class="sep" #sepinout></div>
<div class="modal_itm" (mouseenter)="sepin(sepinout)" (mouseleave)="sepout(sepinout)"><a href="#ab">SOBRE MI</a></div>
<div class="sep" #sepinout></div>
<div class="modal_itm" (mouseenter)="sepin(sepinout)" (mouseleave)="sepout(sepinout)"><a href="#his">HISTORIA</a></div>
<div class="sep" #sepinout></div>
<div class="modal_itm" (mouseenter)="sepin(sepinout)" (mouseleave)="sepout(sepinout)"><a href="#ex">EXPERIENCIA</a></div>
<div class="sep" #sepinout></div>
<div class="modal_itm" (mouseenter)="sepin(sepinout)" (mouseleave)="sepout(sepinout)"><a href="#cont">CONTACTO</a></div>
<div class="sep" #sepinout></div>
</div>
export class NavBarComponent {
sepin(sepinout: HTMLElement){
sepinout.style.translate = "0px"
}
sepout(sepinout: HTMLElement){
sepinout.style.translate = "-2000px"
}
}
The selector tag #sepinout is limited to selecting only one element, making it challenging to select multiple elements simultaneously to execute the function for all items on the list
Attempts were made to use the same selector for multiple elements, but it did not prove effective as the action was only applied to one element
UPDATE / SOLUTION
<div class="modalmenu">
<span class="material-symbols-outlined nbcont_x">close</span>
<div class="modal_itm" (mouseenter)="sepin(sepinout)" (mouseleave)="sepout(sepinout)"><a href="#in">HOME</a></div>
<div class="sep" #sepinout></div>
<div class="modal_itm" (mouseenter)="sepin(sepinout1)" (mouseleave)="sepout(sepinout1)"><a href="#ab">SOBRE MI</a></div>
<div class="sep" #sepinout1></div>
<div class="modal_itm" (mouseenter)="sepin(sepinout2)" (mouseleave)="sepout(sepinout2)"><a href="#his">HISTORIA</a></div>
<div class="sep" #sepinout2></div>
<div class="modal_itm" (mouseenter)="sepin(sepinout3)" (mouseleave)="sepout(sepinout3)"><a href="#ex">EXPERIENCIA</a></div>
<div class="sep" #sepinout3></div>
<div class="modal_itm" (mouseenter)="sepin(sepinout4)" (mouseleave)="sepout(sepinout4)"><a href="#cont">CONTACTO</a></div>
<div class="sep" #sepinout4></div>
</div>
export class NavBarComponent {
sepin(sepinout: HTMLElement){
sepinout.style.translate = "0px"
}
sepout(sepinout: HTMLElement){
sepinout.style.translate = "-2000px"
}
}