I am trying to add css property to my css variable in Jquery.
var cssProp = {
'position': 'absolute',
'top': topPos,
'left': leftPos
}
//this codes works
cssProp.top += 10;
//this is not..
cssProp.z - index = 10;
How to fix this? Thanks a lot!
Dashes in properties when using dot notation are not allowed
Note that css properties when talking about
element.styleall dashed elements in CSS are camel cased in JavaScript so it would propbably actually becssProp.zIndex = 10;