How do I prevent selection scrolling in the body

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".

链接地址: http://www.djcxy.com/p/41394.html

上一篇: 在Firefox中拖动鼠标时如何防止文本选择?

下一篇: 我如何防止正文中的选择滚动