问题描述
:: - webkit-scrollbar {display:none; }
唯一的问题是,这不适用于Firefox。
尝试了很多方法,但仍然无效。
有人可以帮忙吗?
$ b $
下载插件并包括这个函数:
$ b $ pre $ jQuery('html,body')。bind('mousewheel',function(event){
)event.preventDefault();
var scrollTop = this.scrollTop;
this.scrollTop =(scrollTop +((event.deltaY * event.deltaFactor)* -1));
/ /console.log(event.deltaY,event.deltaFactor,event.originalEvent.deltaMode,event.originalEvent.wheelD elta);
});
I just found out how to hide the scrollbar in Google Chrome, I did it with this code:
::-webkit-scrollbar { display: none; }
The only problem is that this doesn't works on Firefox.
Tried many ways to do is but still it doesn't work.
Can someone help with this?
I was able to hide the scrollbar but still be able to scroll with mouse wheel with this solution:
html {overflow: -moz-scrollbars-none;}
Download the plugin https://github.com/brandonaaron/jquery-mousewheel and include this function:
jQuery('html,body').bind('mousewheel', function(event) {
event.preventDefault();
var scrollTop = this.scrollTop;
this.scrollTop = (scrollTop + ((event.deltaY * event.deltaFactor) * -1));
//console.log(event.deltaY, event.deltaFactor, event.originalEvent.deltaMode, event.originalEvent.wheelDelta);
});
这篇关于如何在Firefox中隐藏滚动条?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!