when the page is end .menu() open to top

when the page is end .menu() open to top


Actually how can I explain this issue as English. But I try to show it with picture. I want when the page is end .menu() open to top