search

Home  >  Q&A  >  body text

javascript - 有没有兼容ie的html5历史管理和全屏仿f11的插件

如题html5的历史管理暂时只能支持ie11,有没有能兼容到9之后的插件代码
全屏功能不知道是不是安全的问题ie下的全屏全用不了,只能在google\fierfox之类的能用

PHPzPHPz2901 days ago322

reply all(2)I'll reply

  • 大家讲道理

    大家讲道理2017-04-10 15:00:01

    旧版本IE就不要多想了 老老实实用location.hash简单模拟吧

    至于全屏 百度一下 IE下全屏 F11 能找到相关代码
    new ActiveXObject('WScript.Shell').SendKeys('{F11}')
    非IE的百度一大把 全面一点上MDN

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-10 15:00:01

    var el = document.documentElement
        , rfs = // for newer Webkit and Firefox
               el.requestFullScreen
            || el.webkitRequestFullScreen
            || el.mozRequestFullScreen
            || el.msRequestFullscreen
    ;
    if(typeof rfs!="undefined" && rfs){
      rfs.call(el);
    } else if(typeof window.ActiveXObject!="undefined"){
      // for Internet Explorer
      var wscript = new ActiveXObject("WScript.Shell");
      if (wscript!=null) {
         wscript.SendKeys("{F11}");
      }
    }
    

    reply
    0
  • Cancelreply