Skip to content

Instantly share code, notes, and snippets.

@tmslnz
Created February 25, 2017 15:03
Show Gist options
  • Select an option

  • Save tmslnz/bb087966001d52b169e7ec54e99ba720 to your computer and use it in GitHub Desktop.

Select an option

Save tmslnz/bb087966001d52b169e7ec54e99ba720 to your computer and use it in GitHub Desktop.

Revisions

  1. tmslnz created this gist Feb 25, 2017.
    7 changes: 7 additions & 0 deletions getTranslate3d.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    function getTranslate3d (el) {
    var values = el.style.transform.split(/\w+\(|\);?/);
    if (!values[1] || !values[1].length) {
    return [];
    }
    return values[1].split(/,\s?/g);
    }