I'm trying to build some custom js for an app, and I've got to a point where I need to replicate some css styles from a parent item.
...
match_properties: ['background-color', 'border-radius', 'margin'],
...
var custom_css = [];
$(params['match_properties']).each(function(i, v) {
custom_css.push(v+': '+$(params['object']).css(v));
});
custom_css = custom_css.join('; ');
css_properties = css_properties + custom_css + ';';
Is there anyway from jQuery to get all the 'border-radius' properties from an item ('moz-border-radius', 'webkit....')?
The point is, not to do something like the following, by hand
if(params['match_properties']['border-radius']) {
custom_css.push('-moz-border-radius: '+$(params['object'].css('-moz-border-radius')))
custom_css.push('-webkit-border-radius: '+$(params['object'].css('-webkit-border-radius')))
}
and the reason not to do so, because it would be much more efficient to just pass the 'border-radius', 'box-shadow', or what ever and get all the properties related
$.each(ary, fn);$(params['match_properties'])$.each($(params['match_properties']), function(i, v){})? Why?$.each(params['match_properties'], function(){});