如何启用放大元标记?

时间:2017-07-28 07:42:04

标签: android html css iphone meta-tags

我正在开发一个node.js应用程序,该应用程序也可以在移动设备上运行。但是在某些手机上它的缩放可能是什么原因?

该页面的元标记

<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">

这是我要添加捏缩放的页面。我添加的meta标签是index.html,它是我的应用程序的父页面。那么主要原因是什么呢?

<!DOCTYPE html>
<html lang="en-US">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" type="text/css" href="style.css">
    <link rel="icon" href="favicon.ico">
    <script src="samples.js"></script>
    <title>Chart.js samples</title>
</head>
<body>
    <div class="content">
        <div class="header">
            <div class="chartjs-title">Samples</div>
            <div class="chartjs-caption">Simple yet flexible JavaScript charting for designers &amp; developers</div>
            <div class="chartjs-links">
                <a class="btn btn-chartjs" href="http://www.chartjs.org">Website</a>
                <a class="btn btn-docs" href="http://www.chartjs.org/docs">Documentation</a>
                <a class="btn btn-gh" href="https://github.com/chartjs/Chart.js">GitHub</a>
            </div>
        </div>

        <div id="categories" class="samples-categories"></div>
    </div>

    <script>
        function createCategory(item) {
            var el = document.createElement('div');
            el.className = 'samples-category';
            el.innerHTML =
                '<div class="title">' + item.title + '</div>' +
                '<div class="items"></div>';
            return el;
        }

        function createEntry(item) {
            var el = document.createElement('div');
            el.className = 'samples-entry';
            el.innerHTML = '<a class="title" href="' + item.path + '">' + item.title + '</a>';
            return el;
        }

        var categories = document.getElementById('categories');
        Samples.items.forEach(function(item) {
            var category = createCategory(item);
            var children = category.getElementsByClassName('items')[0];

            (item.items || []).forEach(function(item) {
                children.appendChild(createEntry(item));
            });

            categories.appendChild(category);
        });
    </script>
</body>
</html>

3 个答案:

答案 0 :(得分:1)

world state

答案 1 :(得分:0)

您应该将此元标记用于视口元,实际上您使用了user-scalable:0,它不允许用户放大或缩小。

&#13;
&#13;
<meta name="viewport" content="width=device-width, initial-scale=1">
&#13;
&#13;
&#13;

答案 2 :(得分:0)

从您的HTML中删除SELECT (id - difference + 1) AS available_id FROM ( SELECT id, id - @previous AS difference, @previous := id FROM test, (SELECT @previous := 0) a ORDER BY id) b WHERE b.difference > 1 LIMIT 1; 。它不允许放大和缩小 请检查此link