Reputation: 1
where can i get informations how styles are written in jquery.
for example it is not the normal way z-index it is zIndex... and so on..
fontWeight..
Upvotes: 0
Views: 87
Reputation: 2481
See here also. I have seen cases where the browser (Safari) will only accept it with hyphen...
Upvotes: 0
Reputation: 887255
It's very simple.
All dashes are replaced by camelCase.
Therefore, every time you see a dash, remove it and make the next letter upper case.
Alternatively, you can specify the styles as strings within the JSON keys, and use exactly the same names as CSS.
For example: { "z-index": 4, "background-color": "red" }
.
Upvotes: 1
Reputation: 78262
No need. You can use the CSS style.
$("#ID").css({
'z-index': 100,
'height': '100px'
});
Upvotes: 3
Reputation: 114347
It's not jQuery, it's the way JavaScript handles it.
Here's a chart:
http://codepunk.hardwar.org.uk/css2js.htm
Upvotes: 2