Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable zooming for touch devices in bootstrap framework

I am using twitter bootstrap framework. I want to disable zooming in touch devices. I have already used

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />

this. Without bootstrap framework and i can prevent zooming in touch devices, but with framework i'm not. So is there any workarounds to do that.

Thanks in advance.

like image 821
Dipen Dedania Avatar asked Dec 19 '13 06:12

Dipen Dedania


4 Answers

Write Following code that will disable the mobile zoom disable andy also disable for focus on the any input type

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
like image 186
Ankit Kothari Avatar answered Oct 08 '22 21:10

Ankit Kothari


If you look at Bootstrap documentation, they have said that in order to disable zooming, you must include the following meta tag between opened and closed head tags:

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
like image 34
jmosawy Avatar answered Oct 08 '22 20:10

jmosawy


Guys thanks for the answers. Actually it was my silly mistake. I had a multiple meta's in the page and it was causing the problem. Below code should work for all.

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
like image 25
Dipen Dedania Avatar answered Oct 08 '22 20:10

Dipen Dedania


As other guys mentioned and also you can find in Bootstrap documentation at http://getbootstrap.com/css/#overview-mobile here is the solution

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
like image 32
Mehdi Shahamirian Avatar answered Oct 08 '22 21:10

Mehdi Shahamirian