I have a page which contains a form and few fields. My issues are as follow:
- I am trying to force jQuery UI datepicker to display below the input field.
- When I click in the input field, I want the field to scroll to the top of the page also. I think I have this working.
Here is my jQuery:
JQUERY:
$( document ).ready(function() {
// Set Datepicker
$(".datepicker").datepicker();
$("input").focus(function () {
$('html, body').animate({ scrollTop: $(this).offset().top - 25 }, 10);
});
});
Link to a fiddle: https://jsfiddle.net/MauriceT/0qfycgm1/10/
Here is what I want to avoid:
Datepicker displays above the input field
Any suggestions would be greatly appreciated. Thanks!