I need to convert the fallowing working script as so it works on scroll regardless of how the site is being scrolled.
// // HEADER
$(window).bind('mousewheel', function(event) {
if ($(document).scrollTop() <= 20 || event.originalEvent.wheelDelta > 0 && $(document).scrollTop() <= 105) {
//console.log('large');
headerLarge();
}
else if (event.originalEvent.wheelDelta > 0 && $(document).scrollTop() <= 120) {
//console.log('medium');
headerMed();
}
else if (event.originalEvent.wheelDelta < 0 && $(document).scrollTop() >= 100) {
//console.log('small');
headerSm();
}
});
I tried using the following without success:
$(document).on('scroll', function(event) { ...