|
[其他]
写了引导页以后,点返回会出现白屏现象,
[复制链接]
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title>引导页</title>
<link rel="stylesheet" type="text/css" href="./css/api.css"/>
<link rel="stylesheet" type="text/css" href="./css/style.css"/>
</head>
<body>
</body>
</html>
<script type="text/javascript" src="script/api.js"></script>
<script type="text/javascript">
apiready = function(){
api.setWinAttr({
bounces: false
});
api.setStatusBarStyle({
style: 'light',
color: '#fff'
});
var header=$api.dom('body').offsetHeight;
var $header=$api.dom('body');
var iosheader=$header.offsetHeight;
$api.fixStatusBar( $header);
indexOrGuide();
}
function indexOrGuide(iosheader,header){
if ($api.getStorage('firsttimez')) {
var header = document.querySelector('.header');
$api.fixStatusBar(header);
api.openWin({
name: 'win_home',
url: 'http://fx**.**/mobile',
bounces: false,
rect: {
x: 0,
y: 0,
w: 'auto',
h: 'auto'
}
});
} else {
api.openFrameGroup({
name: 'guide',
background: '#dabb85',
scrollEnabled: true,
bounces: false,
rect: {
x: 0,
y: 0,
w: 'auto',
h: 'auto'
},
index: 0,
frames:[
{
name: 'guide1',
url: './html/guide/guide1.html',
pageParam:{},
bounces:false,
opaque:true,
vScrollBarEnabled:false,
hScrollBarEnabled:false,
bgColor: './res/guide_p1.jpg'
},{
name: 'guide2',
url: './html/guide/guide2.html',
pageParam:{},
bounces:false,
opaque:true,
vScrollBarEnabled:false,
hScrollBarEnabled:false,
bgColor: './res/guide_p2.jpg'
},{
name: 'guide3',
url: './html/guide/guide3.html',
pageParam:{},
bounces:false,
opaque:true,
vScrollBarEnabled:false,
hScrollBarEnabled:false,
bgColor: './res/guide_p3.jpg'
},{
name: 'guide4',
url: './html/guide/guide4.html',
pageParam:{},
bounces:false,
opaque:true,
vScrollBarEnabled:false,
hScrollBarEnabled:false,
bgColor: './res/guide_p4.jpg'
}
]
}, function(ret, err){
var name = ret.name;
var index = ret.index;
$api.setStorage('firsttimez',true);
});
}
};
</script>
这个是引导页的代码,就是在首页点击返回后,会出现白屏现象,再点一下就会提示出现是否退出程序
|
|