Skip to content

translateZ #117

@scien

Description

@scien

local updates...

registerCssHook('z', true);
z: function(z) {
  this.set('translate', null, null, z);
},
if (this._translateZ === undefined) { this._translateZ = 0; }
if (z !== null && z !== undefined) { this._translateZ = unit(z, 'px'); }
this.translate = this._translateX + "," + this._translateY + "," + this._translateZ;
re.push(i + "3d(" + this[i] + ")");
elem.style[support.transform] = value.toString(true);

I've seen the note about scaling in chrome, so point 5 here definitely shouldn't go into prod. I just wanted to keep it simple. ideally this should do something smarter with translate vs translate3d.

Just to note: chrome 25 seems to be handling 3d translations just fine. could either use this code and have the true argument only affect scaling, or as in the last paragraph, know when to use translate(x, y) vs translate3d(x, y, z)

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions