查询Webview窗口是否可见
Boolean wobj.isVisible();
说明:
若Webview窗口已经显示则返回true,若Webview窗口被隐藏则返回false。
参数:
无
返回值:
Boolean : Webview窗口是否可见
示例:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Webview Example</title>
<script type="text/javascript">
var ws=null,embed=null;
// H5 plus事件处理
function plusReady(){
ws=plus.webview.currentWebview();
embed=plus.webview.create("http://weibo.com/dhnetwork","",{top:"46px",bottom:"0px"});
embed.show();
}
if(window.plus){
plusReady();
}else{
document.addEventListener("plusready",plusReady,false);
}
// 查询Webview窗口是否可见
function visibleWebview() {
alert( "是否可见:"+embed.isVisible() );
}
// 隐藏Webview窗口
function hideWebview() {
embed.hide();
}
</script>
</head>
<body>
查询Webview窗口是否可见
<button onclick="visibleWebview()">isVisible</button>
<button onclick="hideWebview()">hide</button>
</body>
</html>