What about this?
var isTransformSupported = "WebkitTransform" in
document.documentElement.style || "MozTransform" in
document.documentElement.style;


On Mon, Oct 20, 2008 at 5:05 PM, kangax <[EMAIL PROTECTED]> wrote:

>
> On Oct 20, 10:19 am, weepy <[EMAIL PROTECTED]> wrote:
> > This is a bit hacky but works :
> >
> >   function transitionsAreSupported() {
> >     var stylesheet = document.styleSheets[0];
> >     stylesheet.insertRule('div#ALongAndUnlikelyId { -webkit-
> > transition: opacity 1s linear; }', 1);
> >     var ret = stylesheet.cssRules[0].style.webkitTransitionDuration !=
> > null
> >     return ret
> >   }
>
> This will fail in IE, which doesn't support `insertRule`. Besides, why
> insert css rule? What about:
>
> var isTransformSupported = (function(){
>  var el = document.createElement('div');
>  var isSupported = ('WebkitTransform' in el.style) || ('MozTransform'
> in el.style);
>  el = null;
>  return isSupported;
> })();
>
> [snip]
>
> --
> kangax
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to