Ho trovato.
Scrivevo style.margin.left invece che style.marginLeft.
tutto a posto