Skip to content

Instantly share code, notes, and snippets.

@danyj
Created March 4, 2019 12:08
Show Gist options
  • Save danyj/0ec4f329cc9d5e29e56a4c0fcd291708 to your computer and use it in GitHub Desktop.
Save danyj/0ec4f329cc9d5e29e56a4c0fcd291708 to your computer and use it in GitHub Desktop.
Creatus Sections Slider Horizontal Demo
$('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