自定义自动完成滚动条jQuery UI的插件 [英] Autocomplete jquery UI plugin with custom scrollbars
问题描述
也有人尝试做出jQuery用户界面自动完成构件自定义滚动?
我想在自动完成构件组合使用jQuery的JScrollPane的组件,但至今没有任何成功。
如果有人知道有关与自定义滚动一些jQuery自动完成组件,或者知道如何更改jQuery用户界面自动完成构件支持JScrollPane组件,我会AP preciate它。
DEMO:的http://so.devilmay$c$c.it/autocomplete-jquery-ui-plugin-with-custom-scrollbars
更新日期:22/09/2015 更新到所有最新版本:1.11.3的jQuery和jQuery的UI 1.11.4,JScrollPane的2.0.22
块引用>....
打开:功能(){
$('UI的自动完成')宽度($(本).WIDTH());
如果(未定义!== _jScrollPane){
_jScrollPaneAPI.destroy();
}
$('UI的自动完成>李)
.wrapAll($('< DIV CLASS =滚动面板>< / DIV>')
.WIDTH($(本).WIDTH())
.height(_jSheight));
_jScrollPane = $('滚动板)。JScrollPane的(设置),
_jScrollPaneAPI = _jScrollPane.data('JSP');
},
关闭:函数(事件,UI){
_jScrollPaneAPI.destroy();
_jScrollPane =不确定;
},
....
请参阅演示源$ C $ C 作为完整的工作code ...感谢。
块引用>did someone try to make custom scrollbars for jquery UI autocomplete widget? I'm trying to use jScrollPane jquery component in combination with autocomplete widget, but so far didn't have any success. If someone knows about some jquery autocomplete component with custom scrollbars, or knows how to change jquery ui autocomplete widget to support jscrollpane component, I would appreciate it.
解决方案
DEMO: http://so.devilmaycode.it/autocomplete-jquery-ui-plugin-with-custom-scrollbars
UPDATED: 22/09/2015 updated to all latest versions: jquery 1.11.3, jquery-ui 1.11.4, jScrollPane 2.0.22
.... open: function() { $('.ui-autocomplete').width($(this).width()); if (undefined !== _jScrollPane) { _jScrollPaneAPI.destroy(); } $('.ui-autocomplete > li') .wrapAll($('<div class="scroll-panel"></div>') .width($(this).width()) .height(_jSheight)); _jScrollPane = $('.scroll-panel').jScrollPane(settings), _jScrollPaneAPI = _jScrollPane.data('jsp'); }, close: function(event, ui) { _jScrollPaneAPI.destroy(); _jScrollPane = undefined; }, ....
Please refer to the demo source code for full working code... thanks.
这篇关于自定义自动完成滚动条jQuery UI的插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!