The wording of the main page
(Function ($, doc) {
Mui.init ({
Swipeback:false,
Subpages: [{
ID: ' Addmembercontent ',
URL: ' addmembercontent.html ',
Styles: {
Top: ' 45px ',
bottom:0,
Bounce: ' Vertical '
}
}]
});
$.plusready (function () {
var Postbtn=doc.getelementbyid (' Bntpost ');//Gets the DOM of the main Page button.
Postbtn.addeventlistener (' Tap ', function () {//Listen to DOM events
var Addmemcont=plus.webview.getwebviewbyid ("Addmembercontent"); Get child pages by ID
var subpages=plus.webview.currentwebview (). Children ();//Get all the sub-pages of the current page;
var addmemcont=subpages[0]; Depending on index or missing sub-page
$.fire (Addmemcont, ' postmember ', null); $.fire (target page, sub-page function, value to pass)
});
The wording of the sub-page:
Window.addeventlistener (' Postmember ', function () {
function to execute}
});
window.addEventListener(‘newsId‘,function(event){ //获得事件参数 var id = event.detail.id;
Hbuilder How to control sub-pages on the main page