Tutorial :Jquery DatePicker changing month using dropdown causing window scroll


I can only see my datepicker when i scroll the page.After scrolling if i click on datepicker , it opens as expected but after changing month using dropdown, the scroll position of window is moved up little bit causing datepciker hidden. So can't click on it.


I would suggest you use the date picker event, 'beforeShow' to run a script to scroll the page to the optimal position.

$('.selector').datepicker({     beforeShow: function(input, inst) { ... }  });  

The jQuery plugin SCROLLTO can help with that. From its page:

With this plugin, you will easily scroll overflowed elements, and the screen itself. It gives you access to many different options to customize and various ways to specify where to scroll.

Again, you would be doing this with the function you specify in the beforeShow option.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »