jQuery 自动完成 : move list position?

标签 jquery css autocomplete position

我想知道是否可以将下拉列表向下移动 4px?

我在 .ui-autocomplete {} 中尝试了几种样式。

包括:

margin-top: 4px;
顶部:4px

但是好像没有效果?

最佳答案

接受的答案不再有效因为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.

你现在应该写:

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

关于jQuery 自动完成 : move list position?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4870625/

相关文章:

javascript - 使用 ajax 和 liferay 当下拉列表中只有一个选项时自动选择

css - jQueryUI 自动完成结果 <ul> 在 IE7 中未正确定位

jquery - 如何检查选择选项是否具有属性 "value"?

javascript - 通过 AJAX 和 jQuery 将变量 XML 作为属性的参数

php - 如何向 HTML 输入字段添加不可删除的后缀?

jquery - 使用 jQuery 获取边框样式

Vim 在 omnicompletion 失败后清除标签

javascript - 在不使用 jQuery 的情况下获取 JavaScript 中的输入值?

css - 摆脱表格中图像之间的垂直空间

php - 菜单元素事件状态