详细问题描述
[内容]
使用plus创建的webview,大小固定,怎么点击灰色区域关闭webview呢?
附件
[代码片段]
plus.webview.create("zhezhao.html", "zhezhao.html", {
width: '200px',
height: '200px',
margin: "auto",
background: "rgba(0,0,0,0.3)",
scrollIndicator: 'none',
scalable: false,
popGesture: 'none'
});
1***@qq.com
- 发布:2018-02-02 09:56
- 更新:2018-02-02 14:11
- 阅读:1523
窗口有遮罩时支持点击遮罩的事件http://www.html5plus.org/doc/zh_cn/webview.html#plus.webview.WebviewEvent;
ws.addEventListener("maskClick",function(){//ws有遮罩的页面
wc.close("auto");//wc是要关闭的页面
},false);
var t = plus.webview.create('text.html','text', {
width: '200px',
height: '200px',
margin: "auto",
background: "rgba(0,0,0,0.2)",
mask:'rgba(0,0,0,0)',
scrollIndicator: 'none',
scalable: false,
backButtonAutoControl:'none',
popGesture: 'none'
})
t.show()
t.addEventListener('maskClick', function(e){
t.close()
}, false );
1***@qq.com (作者)
创建的webview只有红线的区域;后面的大遮罩是background,无法获取到点击事件
2018-02-02 10:42