Created
March 4, 2019 12:08
-
-
Save danyj/0ec4f329cc9d5e29e56a4c0fcd291708 to your computer and use it in GitHub Desktop.
Creatus Sections Slider Horizontal Demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('body').on('mousewheel DOMMouseScroll', function(e){ | |
if(typeof e.originalEvent.detail == 'number' && e.originalEvent.detail !== 0) { | |
if(e.originalEvent.detail > 0) { | |
console.log('Down'); | |
$('.thz-sections-slider .slick-next').trigger('click'); | |
} else if(e.originalEvent.detail < 0){ | |
console.log('Up'); | |
$('.thz-sections-slider .slick-prev').trigger('click'); | |
} | |
} else if (typeof e.originalEvent.wheelDelta == 'number') { | |
if(e.originalEvent.wheelDelta < 0) { | |
console.log('Down'); | |
$('.thz-sections-slider .slick-next').trigger('click'); | |
} else if(e.originalEvent.wheelDelta > 0) { | |
console.log('Up'); | |
$('.thz-sections-slider .slick-prev').trigger('click'); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment