Home > Web Front-end > H5 Tutorial > How to use H5 to add a zoom-disable function

How to use H5 to add a zoom-disable function

php中世界最好的语言
Release: 2018-01-29 09:57:52
Original
4341 people have browsed it

This time I will show you how to use H5 to add a zoom-disable function, and what are the precautions for using H5 to add a zoom-disable function. The following is a practical case, let's take a look.

The following piece of code introduces to you

html5Add the function of prohibiting scaling. The specific code is as follows:

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi" />
Copy after login

ps: Prohibit Html5 from scaling the screen page on mobile phones

I recently tested HTML5 pages and found that by default, users are allowed to zoom in and out of the page, or double-click on the screen to zoom in or out. That is equivalent to setting it like this

<meta name="viewport" content="width=device-width, initial-scale=1.0 user-scalable=yes" />
Copy after login

If you want to prohibit this situation, just modify the corresponding parameters

<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
Copy after login

I believe you have mastered the method after reading these cases. For more exciting things, please pay attention to other php Chinese websites related articles!

Related reading:

How to use H5’s FileReader distribution to read files and an introduction to its methods

How to add HTML Element settings

#How to use the title attribute of html to display text on mouse hover

The above is the detailed content of How to use H5 to add a zoom-disable function. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template