JS: Fix for iPhone & iPad resize bug