-
-
Save FirstVertex/5312032 to your computer and use it in GitHub Desktop.
Revisions
-
FirstVertex revised this gist
Apr 4, 2013 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,10 +16,12 @@ function has3d(){ if( el.style[t] !== undefined ){ el.style[t] = 'translate3d(1px,1px,1px)'; has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]); has3d = (has3d !== undefined && has3d.length > 0 && has3d !== "none"); if (has3d) break; } } document.body.removeChild(el); return has3d; } -
lorenzopolidori revised this gist
Dec 19, 2012 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,11 +2,11 @@ function has3d(){ var el = document.createElement('p'), has3d, transforms = { 'webkitTransform':'-webkit-transform', 'OTransform':'-o-transform', 'msTransform':'-ms-transform', 'MozTransform':'-moz-transform', 'transform':'transform' }; // Add it to the body to get the computed style -
lorenzopolidori revised this gist
Sep 28, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ function has3d(){ }; // Add it to the body to get the computed style document.body.insertBefore(el, null); for(var t in transforms){ if( el.style[t] !== undefined ){ -
lorenzopolidori revised this gist
Sep 28, 2012 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,5 +20,6 @@ function has3d(){ } document.body.removeChild(el); return (has3d !== undefined && has3d.length > 0 && has3d !== "none"); } -
lorenzopolidori revised this gist
Sep 28, 2012 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,5 +19,6 @@ function has3d(){ } } document.body.removeChild(el); return (has3d !== undefined && has3d.length > 0 && has3d !== "none"); } -
lorenzopolidori revised this gist
Sep 27, 2012 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ function has3d(){ var el = document.createElement('p'), has3d, transforms = { 'WebkitTransform':'-webkit-transform', 'OTransform':'-o-transform', @@ -11,7 +12,7 @@ function has3d(){ // Add it to the body to get the computed style document.body.insertBefore(el, document.body.lastChild); for(var t in transforms){ if( el.style[t] !== undefined ){ el.style[t] = 'translate3d(1px,1px,1px)'; has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]); -
lorenzopolidori revised this gist
Sep 27, 2012 . 1 changed file with 2 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,9 +17,6 @@ function has3d(){ has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]); } } return (has3d !== undefined && has3d.length > 0 && has3d !== "none"); } -
lorenzopolidori revised this gist
Sep 27, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,7 @@ function has3d(){ for(t in transforms){ if( el.style[t] !== undefined ){ el.style[t] = 'translate3d(1px,1px,1px)'; has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]); } } -
lorenzopolidori revised this gist
Sep 27, 2012 . 1 changed file with 3 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,19 +8,18 @@ function has3d(){ 'Transform':'transform' }; // Add it to the body to get the computed style document.body.insertBefore(el, document.body.lastChild); for(t in transforms){ if( el.style[t] !== undefined ){ el.style[t] = 'translate3d(0,0,0)'; has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]); } } if (has3d !== undefined && has3d.length > 0) { return has3d !== "none"; } else { return false; } } -
lorenzopolidori revised this gist
Sep 27, 2012 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,9 +18,9 @@ function has3d(){ } } if (has3d !== undefined && has3d.length > 0) { return has3d !== "none"; } else { return false; } } -
lorenzopolidori revised this gist
Sep 27, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ function has3d(){ 'WebkitTransform':'-webkit-transform', 'OTransform':'-o-transform', 'MSTransform':'-ms-transform', 'MozTransform':'-moz-transform', 'Transform':'transform' }; @@ -13,7 +13,7 @@ function has3d(){ for(t in transforms){ if( el.style[t] !== undefined ){ el.style[t] = 'translate3d(0,0,0)'; has3d = window.getComputedStyle(el).getPropertyValue( transforms[t] ); } } -
webinista revised this gist
Sep 4, 2012 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ function has3d(){ var el = document.createElement('p'), t, has3d, transforms = { 'WebkitTransform':'-webkit-transform', 'OTransform':'-o-transform', @@ -8,12 +8,16 @@ function has3d(){ 'Transform':'transform' }; /* Add it to the body to get the computed style.*/ document.body.insertBefore(el, document.body.lastChild); for(t in transforms){ if( el.style[t] !== undefined ){ el.style[ transforms[t] ] = 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)'; has3d = window.getComputedStyle(el).getPropertyValue( transforms[t] ); } } if( has3d !== undefined ){ return has3d !== 'none'; } else { -
webinista revised this gist
Sep 4, 2012 . 1 changed file with 0 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,13 +8,6 @@ function has3d(){ 'Transform':'transform' }; for(t in transforms){ if( el.style[t] !== undefined ){ el.style[ transforms[t] ] = 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)'; -
webinista created this gist
Sep 4, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ function has3d(){ var el = document.createElement('el'), t, has3d, transforms = { 'WebkitTransform':'-webkit-transform', 'OTransform':'-o-transform', 'MSTransform':'-ms-transform', 'MozTransform':'transform', 'Transform':'transform' }; /* Need to add it to the body and set a position to get the computed style. */ document.body.insertBefore(el, document.body.lastChild); el.style.position = 'absolute'; for(t in transforms){ if( el.style[t] !== undefined ){ el.style[ transforms[t] ] = 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)'; has3d = window.getComputedStyle(el).getPropertyValue( transforms[t] ); } } if( has3d !== undefined ){ return has3d !== 'none'; } else { return false; } }