question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prevent page scrolling

See original GitHub issue

Is there a way to prevent page scrolling when the end of content is reached? I expected the onTotalScroll callback to pass an event, which I would hopefully be able to use to prevent the default browser scroll behavior.

I’m trying to migrate an application from nanoscroller.js, and this is a feature nanoscroller provides which I’ve found very useful.

Thanks, great work on the plugin.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
malihucommented, Mar 4, 2015

Yes of course. Set mousewheel: preventDefault option parameter to true: mouseWheel:{ preventDefault: true }

0reactions
ghostcommented, Jan 3, 2017

Not working on android browsers.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prevent body scrolling but allow overlay scrolling
I attempted to create this with just CSS (i.e. a div overlay on top of the whole page and body with overflow: hidden...
Read more >
Prevent Page Scrolling When a Modal is Open | CSS-Tricks
You open a modal, scroll through it, close it, and wind up somewhere else on the page than ... Prevent Page Scrolling When...
Read more >
Prevent Scroll On Scrollable Elements [JS & CSS] - Alvaro Trigo
There's another way to disable scrolling that is commonly used when opening modals or scrollable floating elements. And it is simply by adding ......
Read more >
How to prevent overflow scrolling in CSS - LogRocket Blog
The scroll value of the overflow property adds horizontal and vertical scroll bars so you can adjust or scroll the content if it's...
Read more >
How to disable scrolling on a webpage with JavaScript
In this method we use CSS to disable the scrolling on web pages. In CSS class we set the height to 100% and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found