CamelCase refers to a method of combining words into compound words. Instead of using a hyphen to connect two words, camelCase removes the hyphen or space between the words and capitalizes the second word.
jQuery doesn’t mind if you use camelCase when specifying CSS properties, so ‘border-color’ means the same as ‘borderColor’.
The hyphenated property name should always be used in CSS stylesheets, for example, background-color.
In jQuery either the hyphenated background-color or camelCase backgroundColor could be used.
}, 2000, ‘linear’);
- Single quote marks are needed if the hyphenated property is used, but the non-hyphenated camelCase doesn’t require single quotes around the property name.
- The values for each property should be inside single quotes.
Which case you’ll use comes down to personal preference. I like to type fewer quotes and hyphens, so I tend to use camelCase where ever possible.