AddEventListener not working in IE?

That's because this piece of code in IE I scripts, what's the problem ?

Code flipping through slides in owl.carousel with the mouse wheel.

shpOwl[0].addEventListener('mousewheel', e => {
 if (e.deltaY > 0) {
 $('.shp-slider').trigger('prev.owl', [300]);
 } else {
 $('.shp-slider').trigger('next.owl', [300]);
}
e.preventDefault();
 }, false);
June 5th 19 at 21:10
1 answer
June 5th 19 at 21:12
Solution
Open the console and look. Most likely a problem in arrow functions.
Prompt, than it can be replaced ? in IE the console is fun, sometimes it shows error, sometimes not:) - antonetta.Batz82 commented on June 5th 19 at 21:15
, function(){} - Edwin.Abbo commented on June 5th 19 at 21:18
just sign as a function. - Marcelo15 commented on June 5th 19 at 21:21
Can you help? something don't quite understand where to substitute

shpOwl[0].addEventListener(function() {
 if (e.deltaY > 0) {
 $('.shp-slider').trigger('prev.owl', [300]);
 } else {
 $('.shp-slider').trigger('next.owl', [300]);
}
e.preventDefault();
 }, false);
- antonetta.Batz82 commented on June 5th 19 at 21:24
,
shpOwl[0].addEventListener('mousewheel', function() {
 if (e.deltaY > 0) {
 $('.shp-slider').trigger('prev.owl', [300]);
 } else {
 $('.shp-slider').trigger('next.owl', [300]);
}
e.preventDefault();
 }, false);
- Aurore_Jenki commented on June 5th 19 at 21:27
in function(e) still, thanks. I don't know why FireFox is not responding ?) - antonetta.Batz82 commented on June 5th 19 at 21:30
And why at the same time and jQuery and addEventListener? Maybe you need to have more trust in jQuery? - william.Kuvalis commented on June 5th 19 at 21:33
If I'd known so well to JS/jQuery, it would stick with either JS or jQuery :) - antonetta.Batz82 commented on June 5th 19 at 21:36

Find more questions by tags Internet ExplorerjQueryJavaScript