PDA

View Full Version : Does Element.setStyle() automatically add ventor prefixes?



SunboX
16 Aug 2012, 7:36 AM
How should I deal with ventor prefixes using setStyle().
Does this work? ->


divEl.setStyle('transform', 'scale(1.25, 1)');

Or should I do this?

divEl.setStyle('Moz-transform', 'scale(1.25, 1)');
divEl.setStyle('Webkit-transform', 'scale(1.25, 1)');
divEl.setStyle('Khtml-transform', 'scale(1.25, 1)');
divEl.setStyle('O-transform', 'scale(1.25, 1)');
divEl.setStyle('ms-transform', 'scale(1.25, 1)');
divEl.setStyle('Icab-transform', 'scale(1.25, 1)');

Or this?

divEl.setStyle('MozTransform', 'scale(1.25, 1)');
divEl.setStyle('WebkitTansform', 'scale(1.25, 1)');
divEl.setStyle('KhtmlTransform', 'scale(1.25, 1)');
divEl.setStyle('OTransform', 'scale(1.25, 1)');
divEl.setStyle('msTransform', 'scale(1.25, 1)');
divEl.setStyle('IcabTransform', 'scale(1.25, 1)');

How to deal with prefixes in ExtJS 4.1?

scottmartin
16 Aug 2012, 10:57 AM
I believe you need to manage these yourself. In reviewing the ext-all-debug.css, the rules make adjustments where needed. It may be better to apply css.

Scott.

SunboX
17 Aug 2012, 6:47 AM
applying css wouldn´t do the job. I need to calculate some translation values dynamically. Ok, so whats the best way to set ventor prefixes? With "-" or as camelcased notation?


myDiv.setStyle('webkit-translation', 'scale(1.5, 1)');

vs.


myDiv.setStyle('WebkitTranslation', 'scale(1.5, 1)');