监听列表点击事件(打开新页面并实现页面传值)
2017-09-13 13:14
501 查看
父页:
子页:
window.onload = function(){
needToinput= document.querySelector('.needToinput');
operateButton= document.querySelector('.operateButton');
carNoChoosed = document.getElementById('carNoChoosed');
carDetailList = document.getElementById('carDetailList');
// car_no = plus.webview.currentWebview().carnochoosed;//页面传值
// document.getElementById("carNoChoosed").innerHTML = car_no;
// getlist();
mui.plusReady(function() {
// needToinput= document.querySelector('.needToinput');
// operateButton= document.querySelector('.operateButton');
// needToinput.style.display = 'none';
// operateButton.style.display = 'none';
// carDetailList = document.getElementById('carDetailList');
// car_no = plus.webview.currentWebview().carnochoosed;//页面传值
//
car_no = plus.webview.currentWebview().carnochoosed;//页面传值
carNoChoosed.innerHTML = car_no;
getlist();
//关闭等待框
plus.nativeUI.closeWaiting();
//显示当前页面
mui.currentWebview.show();
//获取原始窗口的高度
var originalHeight=document.documentElement.clientHeight || document.body.clientHeight;
//console.info("原始窗口的高度"+originalHeight);
window.onresize=function(){
//软键盘弹起与隐藏 都会引起窗口的高度发生变化
var resizeHeight=document.documentElement.clientHeight || document.body.clientHeight;
//console.info("软键盘弹起后窗口的高度"+resizeHeight);
if(resizeHeight*1<originalHeight*1){ //resizeHeight<originalHeight证明窗口被挤压了
plus.webview.currentWebview().setStyle({
height:originalHeight
});
}
}
});
}
<ul id="carNoList" class="mui-table-view"style="position:absolute;left:0px;top:80px;right:0px;"> </ul> carNoList = document.getElementById('carNoList'); //监听车号列表点击事件 //function choiceCarNo(){ mui("#carNoList").on('tap', 'li', function(){ var carnochoosed = this.innerHTML.substring(4,11); mui.openWindow({ id: "carNoDetail", url: "carNoDetail.html", styles: { top: '0px', bottom: '0px', left: '0px', bounce: 'vertical', bounceBackground: '#f8f8f8' }, extras : {'carnochoosed':carnochoosed}, waiting: { autoShow: false // title:'正在加载...',//等待对话框上显示的提示内容 // options:{ // width:waiting-dialog-widht,//等待框背景区域宽度,默认根据内容自动计算合适宽度 // height:waiting-dialog-height,//等待框背景区域高度,默认根据内容自动计算合适高度 } }); });
子页:
window.onload = function(){
needToinput= document.querySelector('.needToinput');
operateButton= document.querySelector('.operateButton');
carNoChoosed = document.getElementById('carNoChoosed');
carDetailList = document.getElementById('carDetailList');
// car_no = plus.webview.currentWebview().carnochoosed;//页面传值
// document.getElementById("carNoChoosed").innerHTML = car_no;
// getlist();
mui.plusReady(function() {
// needToinput= document.querySelector('.needToinput');
// operateButton= document.querySelector('.operateButton');
// needToinput.style.display = 'none';
// operateButton.style.display = 'none';
// carDetailList = document.getElementById('carDetailList');
// car_no = plus.webview.currentWebview().carnochoosed;//页面传值
//
car_no = plus.webview.currentWebview().carnochoosed;//页面传值
carNoChoosed.innerHTML = car_no;
getlist();
//关闭等待框
plus.nativeUI.closeWaiting();
//显示当前页面
mui.currentWebview.show();
//获取原始窗口的高度
var originalHeight=document.documentElement.clientHeight || document.body.clientHeight;
//console.info("原始窗口的高度"+originalHeight);
window.onresize=function(){
//软键盘弹起与隐藏 都会引起窗口的高度发生变化
var resizeHeight=document.documentElement.clientHeight || document.body.clientHeight;
//console.info("软键盘弹起后窗口的高度"+resizeHeight);
if(resizeHeight*1<originalHeight*1){ //resizeHeight<originalHeight证明窗口被挤压了
plus.webview.currentWebview().setStyle({
height:originalHeight
});
}
}
});
}
相关文章推荐
- 点击textField,监听键盘事件实现页面上移
- ViewPager子页面的点击事件监听
- asp.net web页面在后台实现打开新页面并传值
- 监听按钮点击事件实现的三种方法
- IOS之UI--自定义按钮实现代理监听点击事件
- C++实现WebBrowser控件中对鼠标点击事件的监听,并获取所点击标签的超链接
- 新增Activity、页面传值跳转和点击按钮触发事件『Android系列九』
- asp.net在事件中启动线程来打开一个页面的实现方法
- Android实现监听按钮点击事件
- android之实现各个组件点击事件监听
- Android实现多次点击监听事件!(4次为例)
- 问题五-实现详细信息页面(点击列表,预览窗口显示具体信息)
- j2se使用ActionListener实现界面上按钮点击的事件监听操作
- Android实现淘宝体验的商品列表排序分类点击事件
- 安卓实现spinner下拉列表以及实现它点击事件
- 安卓中关于事件处理方式以Button为例实现点击事件监听
- android之实现各个组件点击事件监听
- IOS之UI--自定义按钮实现代理监听点击事件
- RecyclerView实现点击和长按事件的监听方法
- java实现table添加右键点击事件监听操作示例