开发者

jQuery ui autocomplete - .ui-autocomplete-loading

开发者 https://www.devze.com 2023-01-18 22:17 出处:网络
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'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 开发者_StackOverflow社区not sure how and where to trigger that in my code.

Thanks


$("#name").addClass( "ui-autocomplete-loading" );

did it and .removeclass removes it

0

精彩评论

暂无评论...
验证码 换一张
取 消