|
apiready = function(){
api.getPrefs({
key: 'splash'
}, function(ret, err){
var v = ret.value;
if(v!="true"){
api.openFrame({
name: 'name',
url: './guide.html',
bounces: false,
rect: {
x: 0,
y: 25,
w: 'auto',
h: 'auto'
},
bgColor:"./image/image/bg.jpg"
});
api.setPrefs({
key: 'splash',
value: 'true'
});
}
setTimeout(function(){
api.removeLaunchView({
animation:{
type:'fade',
duration:500
}
});
},1000)
var first = null;
$.splashBool=false;
api.addEventListener({
name: 'keyback'
}, function (ret, err) {
if($.splashBool||v=="true"){
if (!first) {
first = new Date().getTime();
api.toast({
msg: '再按一次退出TCloud',
duration: 1000,
location: 'bottom'
});
setTimeout(function() {
first = null;
}, 1000);
} else {
if (new Date().getTime() - first < 1000) {
api.closeWidget({
id: 'A0000002200001',
});
}
}
}
});
});
api.openSlidLayout({
leftEdge:80,
type:'left',
fixedPane:{
name: 'homeFixed',
url: './html/homeFixed.html'
},
slidPane:{
name: 'homeSlide',
url: './html/homeSlide.html'
}
}, function(ret) {
/* 暂时不需要做任何事. */
}
);
这样子放对吗? 闪一下就进入主页了。。。 |
|