1

如何检查网页是否在带有地址栏的 Safari 模式下或在 iPad 中没有地址栏的应用模式下运行

             <script>
              if (window.navigator.standalone) {

                  <link type="text/css" href="ipad.css" rel="stylesheet" />



              }


              els{

                  <link type="text/css" href="safari.css" rel="stylesheet" />

              }

              </script>
4

1 回答 1

2

在应用程序模式下,我假设您的意思是从主屏幕启动时:

if (window.navigator.standalone) {

    /* Launched from home screen code */

}

这适用于所有 iOS 设备 ASAIK。

于 2012-04-30T09:29:30.783 回答