|
OpenFrame增加进度条showProgress的方法和实例
[复制链接]
本帖最后由 邓振华 于 2015-11-17 11:13 编辑
- <body>
- <div id="wrap">
- <div id="main">
-
- </div>
- </div>
- </body>
- <script type="text/javascript" src="./script/api.js"></script>
- <script type="text/javascript">
- apiready = function(){
- var connectionType = api.connectionType;
- if(connectionType=="none"){
- Jurl="html/no_wifi.html";
- }else{
- Jurl="http://www**.**/?f=android";
- }
- //frame的高度为当前window高度减去header和footer的高度
- var frameH = api.winHeight;
- api.openFrame({
- name: 'main',
- url: Jurl,
- bounces: true,
- rect: {
- x: 0,
- y: 0,
- w: 'auto',
- h: frameH
- },
- showProgress:true,
- });
-
- };
- </script>
复制代码 上面showProgress:true, 是增加进度条的参数。打开网址是外网http://,内部网页同理。
上面实例还做了是否联网的判断,没有联网的情况下,跳转到:no_wifi.html页面。
|
|