如题,这个问题困扰我三天了,想尽办法,始终没能解决,求助
首先我建了主页面,里面添加了顶部固定的滑动导航
然后新建的子页面。里面数据直接写一个高度1000px的div 这时顶部的导航和内容区都可以滑动
然后内容从服务器获得后,内容区就不能滑动了。
加上下拉刷新,上拉加载后,上面的顶部导航不能滑动了。下面的内容可以滑动了。
附上代码:
1.主页面
<body>
<div class="mui-content">
<div id="nav-w">
<div id="sliderSegmentedControl" class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted mui-pull-left">
<div class="mui-scroll" id="nav_list">
<a class="mui-control-item mui-active" href="javascript:;" fqcat='1'>
女装
</a>
<a class="mui-control-item" href="javascript:;" fqcat='2'>
男装
</a>
<a class="mui-control-item" href="javascript:;" fqcat='3'>
内衣
</a>
<a class="mui-control-item" href="javascript:;" fqcat='4'>
美妆
</a>
<a class="mui-control-item" href="javascript:;" fqcat='5'>
配饰
</a>
<a class="mui-control-item" href="javascript:;" fqcat='6'>
鞋品
</a>
<a class="mui-control-item" href="javascript:;" fqcat='7'>
箱包
</a>
<a class="mui-control-item" href="javascript:;" fqcat='8'>
儿童
</a>
<a class="mui-control-item" href="javascript:;" fqcat='9'>
母婴
</a>
<a class="mui-control-item" href="javascript:;" fqcat='10'>
居家
</a>
<a class="mui-control-item" href="javascript:;" fqcat='11'>
美食
</a>
<a class="mui-control-item" href="javascript:;" fqcat='12'>
数码
</a>
<a class="mui-control-item" href="javascript:;" fqcat='13'>
家电
</a>
<a class="mui-control-item" href="javascript:;" fqcat='14'>
其他
</a>
</div>
</div>
<div id="right-icon">
<span class="mui-icon iconfont icon-jiahao" id="tj"></span><span class="mui-icon iconfont icon-iconbig05" id="ss"></span>
</div>
</div>
</div>
<script src="js/mui.min.js"></script>
<script type="text/javascript">
mui.init({
subpages: [{
url: 'youhuiquanchild.html',
id: 'youhuiquanchild.html',
styles: {
top: '38px', //mui标题栏默认高度为45px;
bottom: '0px' //默认为0px,可不定义;
}
}]
});
var mylist = document.getElementById('mylist')
var nav_btn = document.getElementsByClassName('mui-control-item')
for(var a = 0; a < nav_btn.length; a++) {
nav_btn[a].addEventListener('tap', function() {
var fqcat = this.getAttribute('fqcat')
var target=plus.webview.getWebviewById('youhuiquanchild.html')
mui.fire(target,'postfqcat',{
fqcat:fqcat
});
})
}
</script>
</body>
- 子页面
<body> <div class="mui-content"> <div id="pullrefresh" class="mui-content mui-scroll-wrapper"> <div class="mui-scroll sy" id="mylist" style="min-height: 100px;"> <!--数据列表--> <!--<ul class="mui-table-view mui-table-view-chevron"> <li class="mui-table-view-cell">1</li> </ul>--> </div> </div> </div> <script src="js/mui.min.js"></script> <script type="text/javascript"> mui.init({ pullRefresh: { container: '#pullrefresh', down: { contentdown : "下拉可以刷新",// contentover : "释放立即刷新",// contentrefresh : "正在刷新...",// callback: function downfn(){alert("下拉")} // 下拉执行函数 }, up: { contentrefresh: '正在加载...', callback: function upfn(){alert("下拉")} // 上拉执行函数 } } });
0 个回复