Scroll to the top of the page and back to previous position onclick using Jquery

$(‘.course-header’).click(function() { $("html, body").animate({scrollTop: 0}, "smooth"); return false; }); The page will scroll to the top of the page when ".course-header" clicked but I also want the page to scroll back to the previous (original) position when ".course-header" is clicked again. What can I do to make it happen? I have tried to combining ".toggle()"… Read More Scroll to the top of the page and back to previous position onclick using Jquery