<meta /> 妙啊

1,334 阅读1分钟

页面自动跳转

类似ppt自动跳转的效果,除了可以用定时器实现,还有更简单的meta方法

content第一个值表示时间,单位秒,第二个值url表示跳转的页面

<meta http-equiv="refresh" content="3; url=page2.html" />
自动跳转
自动跳转

页面刷新

页面每隔一段时间自动刷新,如看板数据监控

content为刷新时间间隔,单位秒

<meta http-equiv="refresh" content="3" />
刷新
刷新

伪装app

开启全屏模式时,利用apple-mobile-web-app-capable可以隐藏网页的状态栏工具栏,让它看起来像一个app,默认值为no,显示状态。

apple-mobile-web-app-bar-style 设置头部颜色,可选值为default/black/black-translucent

apple-mobile-web-app-titles设置主屏标题

<meta name="apple-mobile-web-app-capable" content="yes" /> 
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="apple-mobile-web-app-title" content="hi">

先将网页添加到主屏幕,其中hi是未设置参数的,document是设置了的,打开后分别如下图所示。

第二个隐去头尾后,确实类似app。

app广告条

使用apple-itunes-app 可以智能添加app广告条,如下图所示

<meta name="apple-itunes-app" content="app-id=myAppStoreID, affiliate-data=myAffiliateData, app-argument=myURL">
image.png