如何在jQuery自动完成选项中设置自动宽度?
$('#'+pmId).autocomplete('mst_get_masterinfo.php?vValid=15&vRetType=1&vCategory='+vCatCode,{
delay:10,
cacheLength: 0,
width:200,// Width Option
mustMatch:true,
});
答案 0 :(得分:3)
我曾使用open
选项执行此操作,该选项在菜单打开后触发。
$('#'+pmId).autocomplete('mst_get_masterinfo.php?vValid=15&vRetType=1&vCategory='+vCatCode,{
delay:10,
cacheLength: 0,
mustMatch:true,
open: function() {
// After menu has been opened, set width to 100px
$('.ui-menu')
.width(100);
}
});