简体   繁体   中英

How to show the jQuery bootstrap-datetimepicker on mouse over

It is cool http://tarruda.github.io/bootstrap-datetimepicker/ I am using...

I do like

$('#ExpectedEndingTimeDataPicker').mouseover(function () {
     $("#ExpectedEndingTimeDataPicker").datepicker();
});

But no joy... it is showing when click the input tag only...

HTML

<input class="form-control dataPickerField valid" 
       data-val="true" 
       data-val-required="The Expected Ending Time field is required." 
       id="ExpectedEndingTimeDataPicker" 
       name="Requsition.ExpectedEndingTimeAsString" 
       readonly="True" type="text" value="17.01.2014">

According to the documentation ( github link ), use

$('#ExpectedEndingTimeDataPicker').data("DateTimePicker").show();

inside your mouseover handler.

 $('#ExpectedEndingTimeDataPicker').mouseover(function () { $(this).data('daterangepicker').show(); }); 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM