当界面刚载入的时候选项卡里的a标签链接是无效的,
但是向下滚动一点a标签链接就好使了
没有报错,代码如下
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title></title>
<script src="../../../plugin/mui/js/mui.js"></script>
<link href="../../../plugin/mui/css/mui.css" rel="stylesheet"/>
<link rel="stylesheet" href="../../../mobile/global/css/active/active.css" />
<!--下拉刷新和上拉加载-->
<script type="text/javascript" charset="UTF-8" src="../../../plugin/mui/js/mui.pullToRefresh.js" ></script>
<script type="text/javascript" src="../../../plugin/mui/js/mui.pullToRefresh.material.js"></script>
<script>
mui.init({
swipeBack: false
});
window.onload = function(){
(function($) {
$('.mui-scroll-wrapper').scroll({
indicators: true //是否显示滚动条
});
var item2 = document.getElementById('item2mobile');
var item3 = document.getElementById('item3mobile');
document.getElementById('slider').addEventListener('slide', function(e) {
if (e.detail.slideNumber === 1) {
if (item2.querySelector('.mui-loading')) {
setTimeout(function() {
//可以把传值的函数写在这里:
//item2.querySelector('.mui-scroll').innerHTML = html2;
}, 500);
}
} else if (e.detail.slideNumber === 2) {
if (item3.querySelector('.mui-loading')) {
setTimeout(function() {
//可以把传值的函数写在这里:
//item3.querySelector('.mui-scroll').innerHTML = html3;
}, 500);
}
}
});
//阻尼系数
var deceleration = mui.os.ios?0.003:0.0009;
$('.mui-scroll-wrapper').scroll({
bounce: false,
indicators: true, //是否显示滚动条
deceleration:deceleration
});
$.ready(function() {
//循环初始化所有下拉刷新,上拉加载。
$.each(document.querySelectorAll('.mui-slider-group .mui-scroll'), function(index, pullRefreshEl) {
$(pullRefreshEl).pullToRefresh({
down: {
//下拉时调用此函数界面新增信息,可以将刷新信息的函数写在里面
callback: function() {
var self = this;
setTimeout(function() {
self.endPullDownToRefresh();
}, 1000);
}
},
up: {
callback: function() {
//上拉加载时调用此函数界面新增信息,可以将新增信息的函数写在里面
var self = this;
setTimeout(function() {
self.endPullUpToRefresh();
}, 1000);
}
}
});
});
});
})(mui);
}
</script>
<link rel="stylesheet" href="../../../../l/css/comment.css" />
</head>
<body>
<div class="page-group">
<div class="page page-current">
<header class="mui-bar mui-bar-nav">
<a class="mui-pull-left mui-icon mui-icon-arrowthinleft" href="active.html"></a>
<h1 class="mui-title">搜索结果</h1>
</header>
<div class="mui-content">
<div id="slider" class="mui-slider mui-fullscreen">
<div id="sliderSegmentedControl" class="mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
<a class="mui-control-item" href="#item1mobile">
全部
</a>
<a class="mui-control-item" href="#item2mobile">
我参与
</a>
<a class="mui-control-item" href="#item3mobile">
已结束
</a>
</div>
<div id="sliderProgressBar" class="mui-slider-progress-bar mui-col-xs-4"></div>
<div class="mui-slider-group">
<div id="item1mobile" class="mui-slider-item mui-control-content mui-active">
<div id="scroll1" class="mui-scroll-wrapper">
<div class="mui-scroll">
<ul class="mui-table-view">
<li class="mui-table-view-cell">
<a href="../active/detail.html">
<img src="../../../../resources/imgs/mobile/comment/cbd.jpg" />
<span>最新活动信息。免费学习机会</span>
<p>活动类型:学习</p>
<p>时间:2016-2-28</p>
<span class="mark bg-blue">报名中</span>
</a>
</li>
<li class="mui-table-view-cell">
<a href="../active/detail.html">
<img src="../../../../resources/imgs/mobile/comment/cbd.jpg" />
<span>最新活动信息。免费学习机会</span>
<p>活动类型:学习</p>
<p>时间:2016-2-28</p>
<span class="mark bg-red">进行中</span>
</a>
</li>
<li class="mui-table-view-cell">
<a href="../active/detail.html">
<img src="../../../../resources/imgs/mobile/comment/cbd.jpg" />
<span>最新活动信息。免费学习机会</span>
<p>活动类型:学习</p>
<p>时间:2016-2-28</p>
<span class="mark bg-green">已结束</span>
</a>
</li>
<li class="mui-table-view-cell">
<a href="../active/detail.html">
<img src="../../../../resources/imgs/mobile/comment/cbd.jpg" />
<span>最新活动信息。免费学习机会</span>
<p>活动类型:学习</p>
<p>时间:2016-2-28</p>
<span class="mark bg-green">已结束</span>
</a>
</li>
</ul>
</div>
</div>
</div>
<div id="item2mobile" class="mui-slider-item mui-control-content">
<div id="scroll2" class="mui-scroll-wrapper">
<div class="mui-scroll">
<div class="mui-loading">
<div class="mui-spinner">
</div>
</div>
</div>
</div>
</div>
<div id="item3mobile" class="mui-slider-item mui-control-content">
<div id="scroll3" class="mui-scroll-wrapper">
<div class="mui-scroll">
<div class="mui-loading">
<div class="mui-spinner">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
2***@qq.com
有人弄好了吗,我也同样的问题
2016-07-29 12:06