jquery datepicker从单元格获取鼠标悬停的日期 [英] jquery datepicker get the date on mouseover from the cell

查看:185
本文介绍了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();

这篇关于jquery datepicker从单元格获取鼠标悬停的日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆