How to change the pop-up position of the jQuery DatePicker control

Here’s what I’m using:

$('input.date').datepicker({
    beforeShow: function(input, inst) {
        inst.dpDiv.css({
            marginTop: -input.offsetHeight + 'px', 
            marginLeft: input.offsetWidth + 'px'
        });
    }
});

You may also want to add a bit more to the left margin so it’s not right up against the input field.

Leave a Comment