开发者

How do I prevent selection scrolling in the body

开发者 https://www.devze.com 2022-12-24 07:35 出处:网络
I have divs that are placed off-screen. I have disabled scrollbars like so: body { overflow: hidden; } Currently, when I highlight text and drag the mouse outside the window, the body still scroll

I have divs that are placed off-screen.

I have disabled scrollbars like so:

body {
overflow: hidden;
}

Currently, when I highlight text and drag the mouse outside the window, the body still scrolls.

How can I prevent this behaviour? (Setting offscreen elements 开发者_运维知识库to display: none is not an option.)

Thanks!

Travis


What browser is this happening in?

Where, off-screen, are the divs positioned? If they are off to the left or right, you could try using a negative top margin instead, as users are unlikely to highlight "up".

0

精彩评论

暂无评论...
验证码 换一张
取 消