jQuery autocomplete : move list position?

后端 未结 4 1676
梦谈多话
梦谈多话 2021-01-18 04:52

I am wondering if it is possible for me to move the dropdown list down 4px?

I have tried several styles in .ui-autocomplete {}.

including:

4条回答
  •  说谎
    说谎 (楼主)
    2021-01-18 05:39

    The accepted answer is no longer valid because the offset option was deprecated in jQuery UI v1.9 and completely removed in v1.10:

    The offset option has been deprecated and offsets have been merged into the my and at options. The form for a position is now the named position, optionally followed by a plus or minus and then an offset. In addition, offsets now support percentages (see above). You should replace all uses of the offset option with offsets placed inside the my and/or at options.

    You should now write:

    $(".my-autocomplete-field").autocomplete({
        position: {
            my: "left+0 top+4",
        }
    });
    

提交回复
热议问题