2014年3月3日 星期一

[viewport] setup same viewport width for iPhone and Android in responsive design

中文版在這裡

If you want to setup same viewport (e.g. 400) for iphone and android is hard.
  1. width=device-width doesn't work, since each device has different default width.
    default width of iPhone/6/6+ are  320, 375 and 414
    default width of android are 320, 360 and 400
  2. width=400 or width=360 doesn't work in iPhone
  3. width=320, initial-scale=0.8 is not a good solution. iPhone is work, but android doesn't work except user-scalable=1
My solution is control viewport by javascript: