加快jScrollPane(jQuery)中的鼠标滚轮 [英] Speed up mouse wheel in jScrollPane (jQuery)

查看:85
本文介绍了加快jScrollPane(jQuery)中的鼠标滚轮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个固定高度的div,其中有一个ul列表和许多li-items.我将一个jScrollPane应用于div,要为其自定义滚动条的外观.我的代码是这样的:

I have a div with a fixed height and in it a ul-list and many li-items. I apply to the div a jScrollPane for which I want to customize the appearance of the scrollbar. My code is like:

$(function() {
    $('.myDiv').jScrollPane( { showArrows: true, arrowScrollOnHover: true, wheelSpeed: 120 });
});

作为jScrollPane,我使用 http://jscrollpane.kelvinluck.com 的脚本,在职的.但是,尽管如我在上面的示例中所看到的那样,鼠标滚轮的速度(滚动速度)仍然太慢了.

As jScrollPane I use the scripts of http://jscrollpane.kelvinluck.com and it is kind of working. But the speed of the mouse wheel (velocity of scrolling) is much too slow although I tried to set the speed up as you can see in my example above.

有人能起到同样的作用,并且可以给我提示如何加快它的速度吗?

Does anybody has had the same effect and can give me a hint how I can speed it up?

推荐答案

在jquery.jscrollpane.js(甚至.min.js文件)中,在默认值"中找到"mouseWheelSpeed".最初对我来说是3,我将其提高到30.也许是3或30像素/点击.

In the jquery.jscrollpane.js (or even .min.js file), find "mouseWheelSpeed" in the "defaults". This was 3 for me originally, I bumped it up to 30. Perhaps it is 3 or 30 pixles/click.

修改

Sargin Sargin的答案在大多数情况下可能更好.使用他的解决方案,仅当您要为站点周围的重用设置新的默认值时,编辑插件文件才有意义.您还需要记录所做的更改,以便在更新文件时不会丢失自定义.

Sargin Sargin's answer is probably better for most cases. Given his solution, editing the plugin file would only make sense if you wanted to set a new default for reuse around a site. You'd also need to make note of changes made so that you don't lose your customisation when you update the file.

这篇关于加快jScrollPane(jQuery)中的鼠标滚轮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆