Skip to content

Instantly share code, notes, and snippets.

View Golgarud's full-sized avatar

Golga Golgarud

View GitHub Profile
@Golgarud
Golgarud / gist:be0a3b6259e31b9ed30b
Created January 19, 2016 10:42 — forked from zachleat/gist:2008932
Prevent zoom on focus
// * iOS zooms on form element focus. This script prevents that behavior.
// * <meta name="viewport" content="width=device-width,initial-scale=1">
// If you dynamically add a maximum-scale where no default exists,
// the value persists on the page even after removed from viewport.content.
// So if no maximum-scale is set, adds maximum-scale=10 on blur.
// If maximum-scale is set, reuses that original value.
// * <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=2.0,maximum-scale=1.0">
// second maximum-scale declaration will take precedence.
// * Will respect original maximum-scale, if set.
// * Works with int or float scale values.