The My Opera forums have been replaced with forums.opera.com. Please head over there to discuss Opera's products and features

See the new Forums

Getting Prefixed CSS Properties via JavaScript

Forums » Dev.Opera » General Web Development Discussions

You need to be logged in to post in the forums. If you do not have an account, please sign up first.

Go to last post

9. November 2011, 16:21:44

ianlunn

Posts: 3

Getting Prefixed CSS Properties via JavaScript

I have written some jQuery that is working perfectly in WebKit browsers and Firefox. I am now testing in Opera and am having issues with getting the transition duration for an element. This is my code:

slideSpeed = $(".animate-in").css("-o-transition-duration");
console.log("Slide Speed", slideSpeed);

With the following CSS:

.animate-in{
-o-transition-duration: 2.5s;
}

For some reason, Opera doesn't return "2.5s". Can anyone explain why please?

JSFiddle: http://jsfiddle.net/UGdUs/7/

9. November 2011, 21:21:08

burnout426

Posts: 13202

It just doesn't seem to work. Even tried getComputedStyle(jquery_obj.get(0), null).getPropertyValue("-o-transition-duration");

10. November 2011, 09:58:20

ianlunn

Posts: 3

Thanks burnout426. I also asked this question on StackOverflow and it appears to be a bug with Opera:

http://stackoverflow.com/questions/8067268/getting-prefixed-css-properties-in-opera-via-javascript

If you inspect the element, Opera's computed styles shows prefixed properties, such as -o-transition-duration, as being empty values.

11. November 2011, 09:16:06

ianlunn

Posts: 3

I reported it yesterday. Hopefully there will be a fix soon. Thanks for your help.

11. November 2011, 09:59:59

burnout426

Posts: 13202

It turns out that the problem is known and it's bug CORE-31947. Hopefully this will get fixed.

Forums » Dev.Opera » General Web Development Discussions