自定义自动完成滚动条jQuery UI的插件 [英] Autocomplete jquery UI plugin with custom scrollbars

查看:173
本文介绍了自定义自动完成滚动条jQuery UI的插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

也有人尝试做出jQuery用户界面自动完成构件自定义滚动?
我想在自动完成构件组合使用jQuery的JScrollPane的组件,但至今没有任何成功。
如果有人知道有关与自定义滚动一些jQuery自动完成组件,或者知道如何更改jQuery用户界面自动完成构件支持JScrollPane组件,我会AP preciate它。


解决方案

  

  ....
打开:功能(){
  $('UI的自动完成')宽度($(本).WIDTH());
  如果(未定义!== _jScrollPane){
    _jScrollPaneAPI.destroy();
  }
  $('UI的自动完成>李)
    .wrapAll($('< D​​IV 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.

解决方案

....
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屋!

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