javascript – JQuery Chosen阻止自动垂直滚动

我最近发现了jQuery Chosen的一个功能,当你悬停容器的底部时,它会自动向下滚动.chosen-results容器.

Problem

我已经找到了这样做的函数(result_do_highlight):here

这是函数自动滚动发生的部分:

if high_bottom >= visible_bottom
    @search_results.scrollTop if (high_bottom - maxHeight) > 0 then (high_bottom - maxHeight) else 0
else if high_top < visible_top
    @search_results.scrollTop high_top

有没有办法阻止滚动?

先感谢您

编辑

我分叉了Chosen-git并添加一个解决方法github.com/puresamari/chosen

这是如何使用它:

从我这边改变

添加了funtionallity来禁用自动滚动到突出显示的选项:
像这样使用它:

$('your_select').chosen({
  scroll_to_highlighted: false
});

参数’scroll_to_highlighted’是可选的,认为true

最佳答案
我分叉了Chosen-git并添加一个解决方法github.com/puresamari/chosen

这是如何使用它:

从我这边改变

添加了funtionallity来禁用自动滚动到突出显示的选项:
像这样使用它:

$('your_select').chosen({
  scroll_to_highlighted: false
});

参数’scroll_to_highlighted’是可选的,认为true

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: &lt;span id=&quot...
jQuery 添加水印 &lt;script src=&quot;../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...