24

JQuery-UIのオートコンプリートモジュールの設定に問題があります。選択するデータの量が十分に多い場合、スクロールバーが表示される必要があります。

これは私が試したものです:

  • jquery-ui-1.8.16.css私はこれを設定しました:
ui.autocomplete{
    max-height: 100px;
    overflow-y: auto;
    overflow-x: hidden;
}

* ui-documentationの例に示されているように

これは私が入力を宣言してオートコンプリートする方法です:

$("#myInput").autocomplete({
    source: mySource,
    minLength: 0,
});

スクロールバーが表示されない理由がわかりません。助けていただければ幸いです。どうもありがとうございます!

4

1 に答える 1

71

このようなページで設定しているcssをオーバーライドする必要があります

<style>
.ui-autocomplete {
    max-height: 100px;
    overflow-y: auto;
    /* prevent horizontal scrollbar */
    overflow-x: hidden;
    /* add padding to account for vertical scrollbar */
    padding-right: 20px;
}
/* IE 6 doesn't support max-height
 * we use height instead, but this forces the menu to always be this tall
 */
* html .ui-autocomplete {
    height: 100px;
}
</style>

で値を変更する代わりにjquery-ui-1.8.16.css

于 2012-02-14T18:45:53.323 に答える