本文介绍了NiceScroll-保留原始滚动条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我已经在页面上添加了NiceScroll jQuery插件,它确实可以实现我想要的功能(简化了鼠标滚轮事件的滚动).

I've added the NiceScroll jQuery plugin to my page and it does exactly what I'd want it to do (eases scrolling from mouse wheel events).

但是,该插件似乎也可以调整滚动条的样式.使用此插件期间是否可以保留浏览器滚动条的原始样式?

However, the plugin seems geared around styling the scrollbar aswell. Is it possible to preserve the original styling of the browser's scrollbar during use of this plugin?

我已经检查了文档,并尝试了很多参数,但似乎找不到相关的.

I've checked the documentation and tried many parameters but can't seem to find the relevant one.

在当前状态下,滚动条不可见.

In it's current state, the scrollbar is not visible.

推荐答案

我不知道这是否仍然有意义,但是无论如何我都遇到了同样的问题,并找到了解决方案:

I dont know if this still is relevant, but anyways i had the same problem, and found a solution:

只需从插件中删除此部分,在3.4.0版中,它位于第706-711行.

Simply remove this part from the plugin, in version 3.4.0 it is at line: 706-711.

 if (!cap.isie9mobile) self.css(cont,{'overflow-y':'hidden'});

 if (self.ispage&&cap.isie7) {
    if (self.doc[0].nodeName=='BODY') self.css($("html"),{'overflow-y':'hidden'});  //IE7 double scrollbar issue
    else if (self.doc[0].nodeName=='HTML') self.css($("body"),{'overflow-y':'hidden'});  //IE7 double scrollbar issue
 }

如果您不喜欢编辑插件,则必须删除"overflow:hidden;".从主体内联样式开始,这就是插件的作用.

If you dont like editing the plugin, you have to remove the "overflow:hidden;" from the body inline style, this is what the plugin does.

从插件中删除行或以其他方式删除"overflow:hidden;"后,从身体元素.您必须从插件中隐藏滑杆.

When you have either removed the lines from the plugin, or in another way removed the "overflow:hidden;" from the body element. You have to hide the railbar from the plugin.

这就是我所做的:

$(document).ready(function(){
    $("html").niceScroll();
    $('.nicescroll-rails').remove();
});

您可以在此处

这篇关于NiceScroll-保留原始滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 20:14