1

したがって、jquery ui オートコンプリートを備えた 3 つの入力ボックスがあり、そのうちの 2 つのフォント サイズを小さく変更したいと考えています。このようなことを試しましたが、うまくいきませんでした:

$($('.ui-autocomplete-input')[1]).find('.ui-menu-item').find('.ui-corner-all').css('font-size','12px');
4

1 に答える 1

2

リストのレンダリング方法を変更し、liおよび/またはのいずれかにクラスを追加することでそれを行いaます。

jsFiddle

$("#input1").autocomplete({
    delay: 0,
    minLength: 0,
    source: ["One", "Two", "Three"]
}).data("autocomplete")._renderItem = function(ul, item) {
    return $("<li class=\"li-class\"></li>")//added list class here
       .data("item.autocomplete", item)
       .append("<a class=\"a-class\">" + item.label + "</a>") //added the anchor class here.
       .appendTo(ul);
};​
于 2012-09-25T13:08:31.443 に答える