Skip to content
Advertisement

Horizontal scroll jquery-mousewheel library function errors (ex: this. on is not a function)

I am trying to create a horizontal scrolling website and I was following this tutorial which uses this library; however I get a “this.on is not a function” or a similar error where something is not a function.

I have tried rotating my webpage but it just messes everything up (href anchors don’t work?).

I tried to bind the .mousewheel on the window as well to no avail.

Is there another way to do this or is it just not possible?

HTML

JavaScript

CSS

JavaScript

JS

JavaScript

Sorry for the formatting! Thank you!

Advertisement

Answer

The error is coming from the mousewheel library you linked to.

If you were following the tutorial you linked exactly, your issue is probably stemming from the old version of jquery (1.3.2), referenced in that tutorial.

If you update to the latest version of jquery (3.5.1) https://code.jquery.com/, you won’t get that error anymore.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement