CSS often has similar background-image-connected characters, through JavaScript to set the style of this style need to be converted to BackgroundImage hump format, please complete this conversion function
1. The first letter of the second non-empty word is capitalized as a delimiter
2. The result of-webkit-border-image conversion is webkitborderimage
function Cssstyle2domstyle (sName) {
Return Sname.replace (/^\-/, "). Replace (/\-(\w) (\w+)/g, function (A, b,c) {
return b.touppercase () + c.tolowercase ();
});
}
function Cssstyle2domstyle (sName) {var arr = sname.split ('-'); for (var i = 0; I<arr. length; i++) {if (Arr[i]== ") {Arr.splice (i,1); i--; } else{if (i>= 1) {Arr[i] = arr[i].substring (0,1). toUpperCase () + arr[i].substring (1); }}} return Arr.join (");} Without a regular expression, substring () will treat the string as a single character
JS Hyphen Turn Hump