3

I am trying to detect if a browser supports 3d css transform or not . I have looked into every single solution provided on the net but none of them worked for me I then tried using the @support css property for my job . It worked flawlessly in chrome & firefox in Linux , but not in windows .

May be this is because i tested using chrome 23 in both OS , and according to the compatibility table in https://developer.mozilla.org/en-US/docs/CSS/@supports#Browser_compatibility only chrome 24 has support for @support rule.

Any ideas whether this method is suitable for checking support for 3d ? I am concerned only about chrome 23.x and above and firefox 18 and above and not any other browser ,

        @supports(-webkit-transform: perspective( 1px ) )or
                 (-moz-transform: perspective( 1px) ) or
                 (-o-transform: perspective( 1px) ) or
                 (transform: perspective( 1px) ){

              #supports {
                  display:block;
              }

            }
1
  • 3
    Have you tried modernizr.com ? Commented Nov 29, 2012 at 9:05

1 Answer 1

5

You can use Modernizr:

if (Modernizr.csstransforms3d) {
  // CSS 3D Transforms supported
} else {
  // not supported
}
Sign up to request clarification or add additional context in comments.

3 Comments

That just did the trick , thanks a lot. I can't even vote you up :(
This is no longer a valid answer with the current version of Modernizr
As @Michael wrote, this doesn't work any longer. Modernizr addes a class with the feature to the html element. In js I just check if this class is present.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.