I´m working on a responsive wordpress site where on small screens(mobile) I want to scroll to #content when a menu-item is clicked as the menu takes up most of the screenspace. I´ve tried these script but didn´t work.
1
$("#access a").click(function() {
$("#goto").animate({scrollTop: $("#goto").offset().top});
});
2
$("html, body").animate({ scrollTop: $('#goto').offset().top }, 1000);
Is there a simple solution for this?
I answered a similar question a while back here, which worked great.
Based on that answer, try this:
Note, the number 75 can be tweaked to get the page to scroll exactly where you want it to.