I use jQuery's .css()
method to apply styles to an element. I do this like so:
var cssObj = {
'background-color' : '#000',
'background-image': '-webkit-linear-gradient(top,#000,#fff)',
'background-image': 'linear-gradient(top,#000,#fff)'
};
$(".element").css(cssObj);
The problem with this is that obviously I use duplicate keys in the object, which is not cool.
How can I solve this problem? I need to pass the CSS params with duplicate names to address most browsers.