下拉刷新不显示等待文字:PC浏览器打开正常,但是手机端却没有。检查后发现手机上运行时,没有进到下面的_initPocket方法中,但是为什么PC和手机端会表现不一致。不知道该如何解决,请高人指点。
_init: function() {
this._super();
alert("pocket---in");
this._initPocket();
alert("pocket---out");
},
.......
_initPocket: function() {
var options = this.options;
if (options.down && options.down.hasOwnProperty('callback')) {
alert("-----1-----");
this.topPocket = this.scroller.querySelector('.' + CLASS_PULL_TOP_POCKET);
if (!this.topPocket) {
this.topPocket = this._createPocket(CLASS_PULL_TOP_POCKET, options.down, CLASS_LOADING_DOWN);
this.wrapper.insertBefore(this.topPocket, this.wrapper.firstChild);
}
this.topLoading = this.topPocket.querySelector('.' + CLASS_PULL_LOADING);
this.topCaption = this.topPocket.querySelector('.' + CLASS_PULL_CAPTION);
console.log("-----2-----");
console.log(mui(".mui-pull-top-pocket")[0]);
}
if (options.up && options.up.hasOwnProperty('callback')) {
console.log("-----1-up-----");
this.bottomPocket = this.scroller.querySelector('.' + CLASS_PULL_BOTTOM_POCKET);
if (!this.bottomPocket) {
this.bottomPocket = this._createPocket(CLASS_PULL_BOTTOM_POCKET, options.up, CLASS_LOADING);
this.scroller.appendChild(this.bottomPocket);
}
this.bottomLoading = this.bottomPocket.querySelector('.' + CLASS_PULL_LOADING);
this.bottomCaption = this.bottomPocket.querySelector('.' + CLASS_PULL_CAPTION);
//TODO only for h5
this.wrapper.addEventListener('scrollbottom', this);
}
},