Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable auto scroll on JQuery datetime plugin

I am using a JQuery datetime plugin in my application. When I scroll down or up my page and if my mouse pointer comes across date field text boxes then it changes dates because of scrolling. Even if date is not entered in date field then also it scrolls up or down from the current date. How to disable the scrolling on these date fields. You can see this behavior in the official page of this plugin for DatePicker field here: http://xdsoft.net/jqplugins/datetimepicker/

like image 298
user1614862 Avatar asked Dec 15 '22 06:12

user1614862


2 Answers

Pass options scrollMonth and scrollInput to false.

$('.myDatePicker').datetimepicker({
    timepicker : false,
    closeOnDateSelect : true,
    format : 'd-m-Y',
    scrollMonth : false,
    scrollInput : false
});
like image 55
Razib Al Mamun Avatar answered Dec 21 '22 11:12

Razib Al Mamun


set scrollMonth to false

jQuery('#datetimepicker4').datetimepicker({
  format:'d.m.Y H:i',
  lang:'ru',
  scrollMonth : false
});
like image 28
Rahul Avatar answered Dec 21 '22 11:12

Rahul