2015-04-01 58 views

回答

0

我通過緩存元素解決了這個問題,直到發出touchend事件。 觸發touchstart事件的視圖的僞代碼如下所示:

view.remove = function() { 
    if (didViewStartTouchEvents) { 
    var _this = this; 
    this.hideElement(); // display: none, opacity: 0, etc 
    elementCache.appendChild(this); //append this element to some other place like body. Not needed but might be handy depending on situation 
    document.body.addEventListener('touchend', function() { 
     _this.didViewStartTouchEvents = false; 
     _this.remove(); 
    }); 
    } else { 
    // regular remove & cleanup 
    } 
} 
相關問題