var header = document.getElementById("header_parent");
window.onscroll = function(e) {
if(window.scrollY) {
if(window.pageYOffset > 50) {
header.style.height = 30;
} else {
header.style.height = 50;
}
}
}