window.addEventListener('DOMContentLoaded', function() {
var elem = document.querySelector('.name'),
content = document.querySelector('.content'),
isVisible = true;
content.addEventListener('scroll', function() {
var value = 1 - 1 / (this.scrollHeight - this.clientHeight) * this.scrollTop;
elem.style.opacity = value;
if(isVisible != !!value) {
elem.style.display = isVisible ? 'none' : '';
isVisible = !isVisible;
}
});
});