好吧,我写了一个这个代码,它获取元素并为它们做iScroll的东西,但是它不能正常工作,当我用鼠标移动块时它总是返回到起始位置,我是什么我不见了?
initialize: function() {
this.collection = new Products();
this.collection.on('change', this.render, this);
this.collection.on('sync', this.render, this);
this.collection.on('sync', this.init, this);
this.collection.fetch();
var myScroll,myScroll2,myScroll3;
function loaded() {
myScroll = new iScroll('products_container');
myScroll2 = new iScroll('competitors_container');
myScroll3 = new iScroll('features_container');
}
document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
document.addEventListener('DOMContentLoaded', function () { setTimeout(loaded, 200); }, false);
window.addEventListener('load', setTimeout(function () { loaded(); }, 200), false);
},