http://www.shouce.ren/study/api/s/7033

http://www.shouce.ren/example/show/s/7034

 

注意autocomplete与jQuery高版本整合问题(首先这里的高版本指的是jQuery1.9及以上版本)

报错的原因是:在jQuery 从 1.9 版开始,移除了 $.browser 和 $.browser.version , 取而代之的是 $.support 。

那么我们怎么修改文件,是autocomplete能够在jQuery 1.9及以上版本使用呢?

其实很简单,我们把jquery.autocomplete.js 中所有的 browser 改为 support 就可以了

 

 

<input class="txt_normal" style="width:300px;" type="text" >).AutoComplete({
        'data': ['One','Two','Three','Four'],
        'width': 'auto',
        'itemHeight': 30,
        'maxHeight': 200,
        //'maxItems' : 5,
        'listStyle': 'custom',
        'emphasis': false,
        'createItemHandler': function (index, data) {
            return "<span style='color:#333;line-height: 30px;margin-left: 5px;'>" + data.label + "</span>";  // 文本显示为绿色,并在前后使用'--'包裹
        }
        //,
        //'onerror': function (msg) { alert(msg); }
    });

 

 

https://blog.csdn.net/woshizhangliang999/article/details/43636291

云盘:  链接: https://pan.baidu.com/s/1dP822dcSduSnZbrAi4rqCw 提取码: hisa

相关文章:

  • 2022-12-23
  • 2021-10-03
  • 2022-12-23
  • 2021-11-05
  • 2021-06-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-02
  • 2021-11-08
  • 2022-12-23
  • 2022-12-23
  • 2021-08-03
  • 2022-12-23
相关资源
相似解决方案