From 0c22888a80b47d2a1fbfb0cb92cea66fa113b510 Mon Sep 17 00:00:00 2001 From: Thiago Fernandes Date: Sun, 2 Nov 2014 00:01:23 -0200 Subject: [PATCH] container to reuse dom elements --- dragend.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dragend.js b/dragend.js index b11735e..3c8d8ce 100644 --- a/dragend.js +++ b/dragend.js @@ -258,8 +258,10 @@ this._sizePages = proxy( this._sizePages, this ); this._afterScrollTransform = proxy(this._afterScrollTransform, this); - this.pageContainer.innerHTML = container.cloneNode(true).innerHTML; - container.innerHTML = ""; + while (container.childNodes.length > 0) + this.pageContainer.appendChild( + container.childNodes[0] + ); container.appendChild( this.pageContainer ); this._scroll = supportTransform ? this._scrollWithTransform : this._scrollWithoutTransform;