When i open my menu and scroll it downwards, close it and reopen it again, the menu stays at that point, but i want it to be opened at top everytime you open it also with an anchor link.
I've added this to close the menu when clicking the link:
$("li > a").on("click", function() {
$(".drawer-hamburger").trigger("click");
});
Everything works fine, except that its not going to top after re-opening.
I tried:
$('#div').scrollTop();
But this had no effect. The only thing that worked so far was:
window.location.reload(true)
But I think it's overkill to reload the page every time.
Is there a way to close the menu and return the menu to top after re-opening, on click?
This all has to do with this topic,
Turn blivesta animsition menu into off canvas (push body) menu
but because it's a separate question i thought it would be better to start a new topic.
Edit: Let me be more specific about the situation. I open my menu by clicking the hamburger icon. The list is scrollable so when i go down a bit, click the anchor link, the menu closes and i'm at my anchor point. So far so good. When i reopen the menu, it's still at the point in my menu, where i was scrolling to. But i want to be on top of the menu again after re-opening, without refreshing my page.
Edit #2: Watch the fixed result here : http://codepen.io/Jorus/pen/zBLBpy