JQuery ui autocomplete -.ui-autocomplete-loading

I would like to apply this css to the search box while it is extracting the XML file. It currently takes ~ 3 seconds to download this file.

I see these two functions in the autocomplete.js file:

    _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 just don't know how and where to run this in my code.

thank

+3
source share
1 answer
$("#name").addClass( "ui-autocomplete-loading" );

did it and .removeclass deleted it

+1
source

Source: https://habr.com/ru/post/1767604/


All Articles