Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

建议添加ios浏览器input禁止缩放的代码~ #135

Open
frankie2049 opened this issue Jan 18, 2022 · 0 comments
Open

建议添加ios浏览器input禁止缩放的代码~ #135

frankie2049 opened this issue Jan 18, 2022 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers question Further information is requested

Comments

@frankie2049
Copy link

  1. ios端,点击数量或者输入邮箱时,会放大,会出现难看的滚动条~

  2. 解决方法,input的字体,调为16px,然后添加和Js,我自己调整的如下:

<script> // 禁用缩放   function addMeta() {   $('head').append('');} setTimeout(addMeta, 3000);   // 禁用双指放大   document.documentElement.addEventListener('touchstart', function (event) {   if (event.touches.length > 1) {   event.preventDefault();   } }, {   passive: false   }); // 禁用双击放大 var lastTouchEnd = 0; document.documentElement.addEventListener('touchend', function (event) { var now = Date.now(); if (now - lastTouchEnd <= 300) { event.preventDefault(); } lastTouchEnd = now; }, {passive: false }); </script> <style> input{font-size:16px !important} </style>
@frankie2049 frankie2049 added bug Something isn't working good first issue Good for newcomers question Further information is requested labels Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant