分別在安卓、蘋果上測試,瘋狂點擊屏幕,蘋果很好,但是安卓停頓的很厲害。有什么方法解決么?function?Ball?()?{
????var?r?=?Math.floor(Math.random()?*?255);
????var?g?=?Math.floor(Math.random()?*?255);
????var?b?=?Math.floor(Math.random()?*?255);
????this.id?=?Date.now();
????var?ballDiv?=?'<div?id="'?+?this.id?+?'"?class="ball"?style="position:?absolute;?top:?1rem;?left:?9rem;?width:?2rem;?height:?2rem;?background-color:?rgb('?+?r?+?','?+?g?+?','?+?b?+?');"></div>'
????$('body').append(ballDiv);
????this.move();
}
Ball.prototype.move?=?function?()?{
????setInterval(function?()?{
????????var?$dom?=?$('#'?+?this.id);
????????var?t?=?$dom.offset().top
????????$dom.css({?transform:?'translateY('?+?(t?+?.5)?+?'px)'?})
????}.bind(this),?20);
};
setInterval(function?()?{
????new?Ball();
},?2000)
安卓系統(tǒng)微信內(nèi)嵌瀏覽器 touch頁面 css動畫停頓?
weibo_比小麻雀還憤怒_0
2017-11-18 15:19:00