The scroll into view and if statement to read user scroll is working individually but can get them to work together
<script type="text/javascript">
$(window).bind('mousewheel', function(event) {
if (event.originalEvent.wheelDelta >= 0) {
console.log('Scroll up');
window.scrollTo(0,0);
}
else{
document.querySelector('#PROJECTS-2').scrollIntoView();
}}
</script>
Aucun commentaire:
Enregistrer un commentaire