I want to excecute function b after the setTimeout function a has finished. I allready know i need a asynchronous callback function for that but have problems to realise that.
setTimeout(function a (){
element.classList.add('classNameA');
},200);
function b () {
element.classList.add('classNameB');
}
I tried this one but it doesn't work, what is wrong with that?
setTimeout(function a (b){
element.classList.add('classNameA');
},200);
function b () {
element.classList.add('classNameB');
}
EDIT: The function a setTimeout is needed because of an previous transition duration. Function b should get excecuted immediately after function a has done its work.
EDIT: i made my example more clear - i have two different classes i have to add.