jquery datepicker从单元格获取鼠标悬停的日期
问题描述:
我想把鼠标的日期。将出现一个小的分隔符,并显示与该日期相关的一些数据。当鼠标在日历上运行时。我需要鼠标运行的日期,所以我可以调用正确的值来显示在div框中。下面的代码显示从单元格收集的日期。但是我需要包括月和年的完整日期。
I want to get the date on mouse over. A small div-box will appear and display some data related with that date. when mouse is running over the calendar. I need the date where the mouse is running so I will be able to call right values to display in the div-box. The code below show the date gathering from the cell. But I need full date including month and year.
$('.ui-state-default').mouseover(function(){
var a= $(this).text();
alert(a);
});
我还发现这个代码。但对我来说并不真正有效。
任何帮助都不胜感激。
And also I found this code. But does not really work for me. Any help is appreciated.
提前感谢
答
var month = $(this).closest('.ui-datepicker').find('.ui-datepicker-month').text();
var year = $(this).closest('.ui-datepicker').find('.ui-datepicker-year').text();