0

I require a jQuery datepicker that always shows and that I can control the position of. At the moment I can do either one, but not both at the same time.

To always show, I am setting the datepicker on a div, instead of the usual input.

<div id="datepicker"></div>

However, no matter what I try for positioning, the datepicker remains at the bottom of my screen, completely outside the flow of the page.

I have been through every option on threads such as How to change the pop-up position of the jQuery DatePicker control

For example, if I use an input box instead of a div, then the following works:

$("#datepicker").datepicker({
    beforeShow: function (input, inst) {
        setTimeout(function () {
            inst.dpDiv.css({
                top: 100,
                left: 200
            });
        }, 0);
    }
});

One would assume that changing the input parameter to div, on the beforeShow method would work to control the positioning of the datepicker. Alas it does not.

Can anyone point me in the correct direction so I can have a datepicker that it both always showing, and that I can control the position of?

Kind regards James

jamesthemullet
  • 443
  • 4
  • 18

0 Answers0