Is it possible to set the width of a jQuery autocomplete combobox?

后端 未结 14 2271

I am using this jQuery UI combobox autocomplete control out of the box off the jQuery UI website:

My issue is that I have multiple comboboxes on a page, and I want t

14条回答
  •  再見小時候
    2020-12-28 14:23

    Note that I use the code in http://jqueryui.com/demos/autocomplete/#combobox.

    In the _create method, add this line:

        _create: function() {
            var self = this;
            var eleCSS = this.element[0].className; //This line
    

    Then scrolldown a little, find this:

        .addClass("ui-widget ui-widget-content ui-corner-left");
    

    And change this to:

        .addClass("ui-widget ui-widget-content ui-corner-left "+ eleCSS);
    

    HTML

    
    

    Now you can apply CSS to combo-1:

    
    

提交回复
热议问题