Scrolling on Mobile Safari
I'm developing a website and I need the browser to scroll to an anchor. It MUST be animated, so I tried to use jQuery for that. Tried this:
- function goToByScroll(id){
- $('html,body').animate({scrollTop: $("#"+id).offset().top},'slow');
- }
It works perfectly on Firefox and Safari(on the Mac). On Mobile Safari it first goes to the top of the page, then it scrolls to the anchor I want it to scroll to. What's the trick to make it work?
Thanks in advanced!