jQuery用户界面自动完成 - 的.ui-自动完成加载 [英] jQuery ui autocomplete - .ui-autocomplete-loading
本文介绍了jQuery用户界面自动完成 - 的.ui-自动完成加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想而这是获取XML文件到这个CSS应用到搜索框。目前,它大约需要3秒加载此文件。
我在autocomplete.js看到文件这两个函数:
_search:函数(值){
this.term = this.element
.addClass(UI-自动完成预加载)
//一直留有实际值,而不是一个作为参数传递
.VAL(); this.source({项:值},this.response);
},_response:功能(内容){
如果(content.length){
内容= this._normalize(内容);
this._suggest(内容);
this._trigger(开放);
}其他{
this.close();
}
this.element.removeClass(UI-自动完成装载);
},
我只是不知道如何以及在何处触发,在我的code。
感谢
解决方案
$(#名称)addClass(UI-自动完成预加载)。
做到了,.removeclass删除它。
I'd like to apply this css to the search box while it is fetching the XML file. Currently it takes ~3 seconds to load this file.
I see in the autocomplete.js file these two functions:
_search: function( value ) {
this.term = this.element
.addClass( "ui-autocomplete-loading" )
// always save the actual value, not the one passed as an argument
.val();
this.source( { term: value }, this.response );
},
_response: function( content ) {
if ( content.length ) {
content = this._normalize( content );
this._suggest( content );
this._trigger( "open" );
} else {
this.close();
}
this.element.removeClass( "ui-autocomplete-loading" );
},
I'm just not sure how and where to trigger that in my code.
Thanks
解决方案
$("#name").addClass( "ui-autocomplete-loading" );
did it and .removeclass removes it
这篇关于jQuery用户界面自动完成 - 的.ui-自动完成加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文