zoukankan      html  css  js  c++  java
  • iOS scaling bug fix

    
    // iOS scaling bug fix
    // Rewritten version
    // By @mathias, @cheeaun and @jdalton
    // Source url: https://gist.github.com/901295
    (function(doc) {
        var addEvent = 'addEventListener',
        type = 'gesturestart',
        qsa = 'querySelectorAll',
        scales = [1, 1],
        meta = qsa in doc ? doc[qsa]('meta[name=viewport]') : [];
        function fix() {
            meta.content = 'width=device-width,minimum-scale=' + scales[0] + ',maximum-scale=' + scales[1];
            doc.removeEventListener(type, fix, true);
        }
        if ((meta = meta[meta.length - 1]) && addEvent in doc) {
            fix();
            scales = [0.25, 1.6];
            doc[addEvent](type, fix, true);
        }
    }(document));
    
  • 相关阅读:
    分布式事务-第一刀
    Qt
    自描述C++部分面试题集
    读书笔记6.21
    STL vector容器 和deque容器
    C++ STL框架
    C++ 多态
    C++ 虚继承
    C++ 类的继承和派生
    C++ 类中的函数重载
  • 原文地址:https://www.cnblogs.com/rubylouvre/p/2581831.html
Copyright © 2011-2022 走看看