When using disableBodyScroll, set stored scrollTo value to the initia…#91
When using disableBodyScroll, set stored scrollTo value to the initia…#91bwshen wants to merge 3 commits intogromo:masterfrom
Conversation
…l scrolled position, as well as upon subsequent calls to init
|
How do you change scroll position? Do you use jQuery scrollTop/scrollLeft? Can you prepare example with wrong behavior on jsFiddle.net using original jquery.scrollbar.js file? |
|
here's a jsfiddle: When you attempt to use the mousewheel, if you mousewheel down, you are scrolled to the top, if you mousewheel up, it doesn't scroll. |
|
apologies, try https://jsfiddle.net/tjqgxkd9/5/ |
|
Pretty interesting. If you use mousewheel over scrollbar it works correctly. Idea was that disableBodyScroll handles mousewheel and trigger the same event for scrollbars. I will look at the code in next few days Upd. fix should be like this: trigger mouseenter event on scrollbar and only then use mousewheel event |
|
something like this? |
|
https://jsfiddle.net/tjqgxkd9/6/ - quick hack |
|
But much better if you set scrollTop offset first and only then initialize scrollbar |
… the scrollable container to handle changes in stored scrollValue to support disableBodyScroll
…l scrolled position, as well as upon subsequent calls to init.
Hi Gromo, didn't find any information on the best way to submit proposed changes. If you'd prefer that i open up an issue or something else instead let me know.
I have the use case where i programatically scroll to a position initially. however when i mousewheel with disableBodyScroll: true, the mousewheel, assumes that initial scroll is 0, instead of the actual value and scrolls there.
thxs!