So right now I have created an onload function in Javascript.... but it's already late when I found out that I can't use any onLoad javascript function with the app I'm working on :(
<script type="text/javascript">
var sticky = document.querySelector('.sticky');
var origOffsetY = sticky.offsetTop;
function onScroll(e) {
window.scrollY >= origOffsetY ? sticky.classList.add('fixed') :
sticky.classList.remove('fixed');
}
document.addEventListener('scroll', onScroll);
</script>
Someone recommended me to use BindListeners but I have no idea how it would work? Any help? I can't use jQuery as well....