如何隐藏mozilla Firefox中的滚动条 [英] How to hide scrollbar in mozilla firefox
本文介绍了如何隐藏mozilla Firefox中的滚动条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
:: - 我只是在google chrome中找到了如何隐藏滚动条, webkit-scrollbar {display:none; }
唯一的问题是这在firefox上不起作用。
尝试了许多方法,但仍然无法工作。
有人可以帮助这个。
<我可以隐藏滚动条,但仍然可以滚动鼠标滚轮与此解决方案:
<$> p $ p>
html {overflow:-moz-scrollbars-none;}
>下载 https://github.com/brandonaaron/jquery-mousewheel 插件并加入此功能:
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);
});
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 doesnt 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);
});
这篇关于如何隐藏mozilla Firefox中的滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文