骨干网中的iScroll将对象返回到起始位置

时间:2013-08-22 07:04:29

标签: javascript jquery backbone.js iscroll

好吧,我写了一个这个代码,它获取元素并为它们做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);
    },

0 个答案:

没有答案