splice in javascript(vue) not working as expected after adding class dynamically

I’m trying to delete an element from an array using array splice method. I’m also using animate.css and I dynamically add the class ‘fadeOutDown’ before deleting the element. Then I’m using a timeout function to wait for the animation to complete and remove the element from the array using index. When I click the delete button the index of the element performs the animation but additionally the very next index is also removed from the DOM but not from the array. Below the html and js-function for removing the element: Answer The problem is that using index as key. You

Toggle multiple divs with multiple buttons using animate.css – jQuery

I have three different buttons with three different divs that each toggle an applicable div in same place. Trying to do 2 things. Add class on .app-icon button when relative .app-div is showing so that I can add background color when active. Add an animate.css effect when toggling same .app-div open and closed so that when the div disappears it slides down, rather than just abruptly disappearing. HTML: jQuery: Here’s what I have so far: https://jsfiddle.net/frshjb373/a5osx7y6/3/ Answer One option is to handle an if statement checking if the icon clicked is actually active like this: Updated Demo