Paul Boag

iOS safari resizing issues

Published:
17 July 2012
Categories:
Development Mobile
Reading time:
1 minutes

Just a quick heads up about a peculiar little problem I encountered today. Like all the ‘cool kids’ I try and make all new sites I develop responsive. That includes the Headscape website, which I am currently redesigning. I had to use jquery once or twice to detect resizing in the browser and tweak accordingly.…

Warning! The post you are viewing is out of date and almost certainly no longer accurate. For more topical posts, check out the “related reading” at the bottom of this page or drop me an email with any questions.

Just a quick heads up about a peculiar little problem I encountered today.

Like all the ‘cool kids’ I try and make all new sites I develop responsive. That includes the Headscape website, which I am currently redesigning.

I had to use jquery once or twice to detect resizing in the browser and tweak accordingly. Yes, I know this isn’t ideal, but it was the only way of doing what I wanted. It also works perfectly fine without the Javascript, so get off my back ;-)

Here is the interesting problem. iOS safari seems to randomly trigger resize events when the page first loads.

The only way you can stop it doing this is to fix the height of your HTML and Body tags:

height: 100%; overflow: auto; margin: 0;

The problem you will have is that this kills the nice inertia scrolling you get on touch devices. To re-enable this add the following line of code to HTML and Body:

-webkit-overflow-scrolling: touch;

I spent half the day fighting with this little problem so I thought it was worth posting the solution for others.

  • Free access to 3 books including Click! that teaches you how to encourage clicks without shady tricks.
  • Choose between multiple email courses.
  • Choose between in-house or freelancers and agencies content.
  • Learn from an expert with over 30 years experience.

About me

I’m a UX consultant and conversion troubleshooter with 32 years in digital. I help teams create user experiences that work; winning support, improving results, and making change stick.

Contact me

Email: [email protected]
UK Based – Clients in North America, Europe, Asia, Australia.

how I help

  • UX Strategy – Spot what’s blocking a great experience and get a clear plan to fix it.
  • Improving Conversion – Simple, evidence-based changes that make every click count.
  • Coaching & Leadership – A sounding board to help you lead with clarity and confidence.
  • Training & Workshops – Hands-on sessions, playbooks, and self-learning so your team keeps improving.