I am doing this:
var sId=id.toString();
var index=sId.substring(3);
var mrg=index*221;
var el=$(id);
el.css('margin-left',mrg+'px'); and el.css('marginLeft',mrg+'px');
el is the element i want to set the margin to (correctly retrieved) and mrg is the value of the new margin
If i do $('#test1').css('margin-left',200); or $('#test1').css('marginLeft',200); it works in both ways, it’s something wrong with the way i set the property.
The correct way is var el=$('#'+id);
try