margin-top in javascript code example
Example 1: modify margin top javascript
window.onscroll = function() { document.getElementById('id').style.margin = '40px 0 0 0' }
Example 2: css margin top
.yourClass {
margin-top: 25px;
}
window.onscroll = function() { document.getElementById('id').style.margin = '40px 0 0 0' }
.yourClass {
margin-top: 25px;
}