Activate href if elements top equals zero after addClass jQuery

I have a simple menu, everytime i click an element the others fadeOut and the clicked one goes up if it’s not the first element, and after that i activate the href of the link.

To activate the link i need to make sure that the element is in the top of the page, after the addClass slideUpSm the clicked item gets new position top

setTimeout(function() {$('.main-nav li').addClass('slideUpSm')}, 1200);

After that, i can activate the window location, i have tried the hasClass methode and also tried to check if the new position top equals zero, here is my attemt https://jsfiddle.net/bsq3dL4t/

setTimeout(function() {window.location = href}, 100);