访问供应商特定的CSS属性w / JavaScript [英] Accessing vendor-specific CSS properties w/JavaScript

查看:69
本文介绍了访问供应商特定的CSS属性w / JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很好奇,如何访问/修改 -moz-transition (或任何属性从这个列表)通过本地javascript,即不依赖于jQuery的 .css ');

I am curious how one would access/modify properties like -moz-transition (or any property from this list) by means of native javascript i.e. without relying on jQuery's .css('property', 'value');

例如,要更改元素的 background-color 使用 element.style.backgroundColor

For instance, to change an element's background-color one would work with element.style.backgroundColor.

做供应商特定的属性名称只是获得camelCased并可操作?我不能这样做,也许他们不再由 style 的属性表示,应该在其他地方修改?

Do vendor-specific property names just get camelCased and become operable? I couldn't do so, maybe they are no longer represented by properties of style and should be modified elsewhere? Or maybe they are not accessible through DOM at all?

推荐答案

使用上骆驼案例,例如 el .style.MozTransition

Use upper camel case, e.g., el.style.MozTransition.

示例: http://jsfiddle.net/R3y6f/1/

这篇关于访问供应商特定的CSS属性w / JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆