我想知道是否可以将下拉列表向下移动 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 themy
andat
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 theoffset
option with offsets placed inside themy
and/orat
options.
你现在应该写:
$(".my-autocomplete-field").autocomplete({
position: {
my: "left+0 top+4",
}
});
关于jQuery 自动完成 : move list position?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4870625/