Changing width of jquery-ui autocomplete widgets individually

前端 未结 11 893
挽巷
挽巷 2020-12-14 16:42

I\'m working with mutiple jquery-ui autocomplete widgets on one page and want to be able to set the widths of each one individually. Currently, I\'m doing it like this:

11条回答
  •  轮回少年
    2020-12-14 17:04

    I resolved this issue using the 'open' event available. I needed a way to dynamically set the width, along with other items and did not want extra markup.

    $('#input').autocomplete({  
        source: mysource,  
        appendTo: '#div',  
        open: function() { $('#div .ui-menu').width(300) }  
    });
    

提交回复
热议问题