close( )

MUI HTML5

MUI

close( )

关闭Webview窗口


void wobj.close( aniClose, duration );
						

说明:

关闭并销毁Webview窗口,可设置关闭动画和动画持续时间。

参数:

  • aniClose: ( AnimationTypeClose ) 可选 关闭Webview窗口动画效果
    如果没有指定关闭窗口动画,则使用显示时设置的窗口动画相对应的关闭动画。
  • duration: ( Number ) 可选 关闭Webview窗口的动画持续时间
    单位为ms,默认为窗口show方法设定的动画时间。

返回值:

void : 无

示例:


<!DOCTYPE html>
<html>
	<head>
	<meta charset="utf-8">
	<title>Webview Example</title>
	<script type="text/javascript">
var ws=null;
// H5 plus事件处理
function plusReady(){
	ws=plus.webview.currentWebview();
}
if(window.plus){
	plusReady();
}else{
	document.addEventListener("plusready",plusReady,false);
}
// 关闭窗口
function closeMe() {
	ws.close();
}
	</script>
	</head>
	<body>
		关闭Webview窗口
		<button onclick="closeMe()">Close</button>
	</body>
</html>