Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
shrekshrek committed Jan 29, 2016
1 parent a37b8d8 commit ae17c23
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
13 changes: 7 additions & 6 deletions css3d.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,20 +370,21 @@
switch (typeof params.el) {
case 'string':
_dom = document.createElement('div');
_dom.style.position = 'absolute';
_dom.innerHTML = params.el;
break;
case 'object':
if (params.el.nodeType === 1) _dom = params.el;
if (params.el.nodeType === 1){
_dom = params.el;
}
break;
}
}

if (!_dom) {
_dom = document.createElement('div');
_dom.style.position = 'absolute';
}

_dom.style.position = 'absolute';
_dom.style[prefix + 'Transform'] = 'translateZ(0px)';
_dom.style[prefix + 'TransformStyle'] = 'preserve-3d';
this.el = _dom;
Expand Down Expand Up @@ -779,13 +780,13 @@
var _o;
switch (obj.type) {
case 'sprite':
_o = new C3D.Sprite();
_o = new C3D.Sprite(obj.el ? {el: obj.el} : undefined);
break;
case 'plane':
_o = new C3D.Plane();
_o = new C3D.Plane(obj.el ? {el: obj.el} : undefined);
break;
case 'cube':
_o = new C3D.Cube();
_o = new C3D.Cube(obj.el ? {el: obj.el} : undefined);
break;
}

Expand Down
Loading

0 comments on commit ae17c23

Please sign in to comment.