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:
margin-top: 4px;
top: 4px
but it does not seem to be working?
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 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.
You should now write:
$(".my-autocomplete-field").autocomplete({
position: {
my: "left+0 top+4",
}
});
This is what the offset
property of the position
option is for:
$('#myField').autocomplete({
source: …,
position: {
offset: '0 4' // Shift 0px left, 4px down.
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With