- var i;
- var slides = this.grid.children;
- for (i=0 ; i<doc.children.length ; i++) {
- this.lastSlide = this.grid.appendChild(getCopyOfNode(doc.children[i]));
+ var i, node, c;
+ for (i=0 ; i<doc.childNodes.length ; i++) {
+ node = doc.childNodes[i];
+ if (node.nodeType === 1) {
+ this.lastSlide = this.grid.appendChild(getCopyOfNode(node));
+ this.slides.push(this.lastSlide);
+ if (this.cbIndex) {
+ c = this.lastSlide.getElementsByTagName('input')[0];
+ c.index = this.cbIndex.length;
+ this.cbIndex.push(c);
+
+ }
+ }