如果已添加到主屏幕,请隐藏工具提示

时间:2012-09-19 04:15:21

标签: javascript jquery iphone ios

我正在使用this plugin来显示用于将网站添加到主屏幕的工具提示,但是一旦添加,我就不希望工具提示再次出现。该文档说我应该添加一个元标记:

<meta name="apple-mobile-web-app-capable" content="yes">

我做了但我仍然每次都看到工具提示。我做错了什么?

1 个答案:

答案 0 :(得分:3)

您可以在包含插件的JS文件之前设置addToHomeConfig来禁用插件的自动启动。

var addToHomeConfig = {
    autostart : false
    //add your other options here
};
//use script tag to include the plugin.

然后,通过插入以下代码来检测应用程序是否在“Web App Mode”中运行

if (("standalone" in window.navigator) && !window.navigator.standalone){
    //show fullscreen tooltip
    addToHome.show();  //this shows the tooltip
}