Mr Ivac
Mr Ivac

Reputation: 3

css fixed positioning on ios

I'm working on a website with a bottom menu that is placed by using fixed positioning in css. The menu works fine and stays in the bottom on sevral browsers. However, when i visit the website on a iPad it looks good at first but when I switch page within the website and then press the back button, the bottom menu gets stuck in the middle of the screen. Any ideas on how to solve this?

Upvotes: 0

Views: 340

Answers (1)

user1882042
user1882042

Reputation: 61

I've had the same problem previously.

I managed to go around the issue by scrolling 1 pixel when the page loads.

window.onload = window.onpageshow = function () { OnPageload(); };
function OnPageload() {
    window.scrollTo(window.pageXOffset + 1, window.pageYOffset + 1);
}

Upvotes: 1

Related Questions