Modificar JavaScript de margem superior

window.onscroll = function() { document.getElementById('id').style.margin = '40px 0 0 0' }
SoftwareUp