Jump to content

OnScroll only when moved by mouse or mousewheel


Jonathan2
 Share

Recommended Posts

Hello,

Im using a script to scroll the scrollbar on browser resize.

If there is no scrollbar and it is resized until there is a scrollbar it will be centered so I use a calculation like this:

scrollbar length / scroll bar divider

When it is centered the divider is 2.

Now I want to remember the relative scrollbar position when scrolling, for this I calculate the scroll bar divider onscroll, but the event also fires when the resize script is called.

I somehow only want the onscroll script to fire when the scrollbar is used by mouse or mousewheel.

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...