實現列表頁動態加載
經過官方提供的"下拉刷新和上拉刷新"及"圖片懶加載"示例實現。javascript
http://www.cnblogs.com/phillyx/java
$.fn.imageLazyload = function(options) { var lazyloadApis = []; this.each(function() { var self = this; var lazyloadApi = null; if (self === document || self === window) { self = document.body; } //對,bug就在這,斷定時若是body已有該屬性,就不在加載了,總體的代碼沒看明白,註釋太少了啊 var id = self.getAttribute('data-imageLazyload'); if (!id) { id = ++$.uuid; $.data[id] = lazyloadApi = new ImageLazyload(self, options); self.setAttribute('data-imageLazyload', id); } else { lazyloadApi = $.data[id]; } lazyloadApis.push(lazyloadApi); }); return lazyloadApis.length === 1 ? lazyloadApis[0] : lazyloadApis; }
document.body.removeAttribute('data-imagelazyload'); mui(document).imageLazyload({ placeholder: '../../images/img_head3.png' });
那麼問題來了:chrome
最新的解決方案參考DCloud問答的官方回覆ui