[英]How to disable or hide the scroll to top button programmatically with HTML/CSS/JS? (Samsung Internet Browser)
[英]How to disable page scroll in html/css/js?
我正在使用html/css/js制作网站,但由于我添加了一些效果,出现了滚动。 但我不希望用户看到滚动条,甚至用鼠标中键滚动。 我能做些什么来解决这个问题?
您可以在 CSS 中使用
overflow:hidden
https://developer.mozilla.org/de/docs/Web/CSS/overflow
或者如果你想滚动但你可以隐藏它
/* Hide scrollbar for Chrome, Safari and Opera */
.example::-webkit-scrollbar {
display: none;
}
/* Hide scrollbar for IE, Edge and Firefox */
.example {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_hide_scrollbar_keep_func
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.