TashinV
V2EX  ›  问与答

有没有高手可以写一个css 文件,让lion 下的safari 在进入全屏模式后自动将页面扩大到144% 的?感激不尽啦。

  •  
  •   TashinV · Sep 16, 2011 · 5153 views
    This topic created in 5537 days ago, the information mentioned may be changed or developed.
    不知道有没有高手可以相助。
    8 replies  •  1970-01-01 08:00:00 +08:00
    chone
    chone
    Sep 16, 2011
    1
    单纯css好像不容易做到把,js根据页面宽度变化来放大可能能达到目的
    TashinV
    TashinV
    OP
    Sep 16, 2011
    2
    @chone 那有办法写个js 文件么?
    NemoAlex
    NemoAlex
    Sep 16, 2011
    3
    http://www.apple.com.cn/safari/features.html
    很想知道“新的全屏 JavaScript API”在哪里可以找到文档
    Livid
    Livid
    MOD
    PRO
    Sep 16, 2011
    4
    Safari 的这个 features 页面真是壮观。
    sparanoid
    sparanoid
    Sep 16, 2011
    5
    一个笨办法,我觉得可以根据你的屏幕分辨率做一个:

    @media (min-width: 1920px) {
    :root {
    zoom: 1.44;
    }
    }
    chone
    chone
    Sep 16, 2011
    6
    @TashinV

    var FULL_CLASS = 'fullmode';

    var addCssClass = function(el, className) {
    removeCssClass(el, className);
    el.className += ' ' + className;
    };

    var removeCssClass = function(el, className) {
    el.className = el.className.replace(className, '');
    };


    window.addEventListener('resize', function() {
    var body = document.body;
    if (screen.width == window.outerWidth && screen.height == window.outerHeight) {
    // 我不太确认window.fullScreen是否也能工作
    addCssClass(body, FULL_CLASS);
    } else {
    removeCssClass(body, FULL_CLASS);
    }
    }, false);

    ///css
    body.fullmode {zoom: 114%;}
    chone
    chone
    Sep 16, 2011
    7
    @NemoAlex 是指onwebkitfullscreenchange?
    Numbcoder
    Numbcoder
    Sep 16, 2011
    8
    稀饭lz的头像、,
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2264 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 58ms · UTC 02:44 · PVG 10:44 · LAX 18:44 · JFK 21:44
    ♥ Do have faith in what you're doing.