3

如何在 jQuery 自动完成选项中设置自动宽度?

$('#'+pmId).autocomplete('mst_get_masterinfo.php?vValid=15&vRetType=1&vCategory='+vCatCode,{
      delay:10,
      cacheLength: 0,
      width:200,// Width Option
      mustMatch:true,
});
4

1 回答 1

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);
    }  
});
于 2012-05-22T07:03:22.033 回答