When clicking an input field on an iOS device, it will zoom in on that element. Can i disable this focus event?
I put up this gist which solves the problem. https://gist.github.com/2008932
The accepted solution is not correct, as it will cancel focus altogether, which prevents data entry.
I think you would be better to set the viewport:
<meta name="viewport" content="width=device-width, user-scalable=no" />
See this thread
document.getElementById("idOfInputField").onfocus = function(){return false;}
Best solution to disable auto zoom in mobile devices on touch event
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
精彩评论