所以我正在使用http://amsul.ca/pickadate.js/并且我试图从任何 pickadate 事件处理程序中引用 DOM 中的日期对象。
例如,我希望能够说:
onClose: function() {
var $this = ?; // <-- How do I define $this?
$this.fadeOut();
}
问题:
您如何从这些事件处理函数之一中引用当前的 DOM 元素?
笔记:
this, $(this) and $this don't seem to work :-(
代码:
var dates = $('.dates');
dates.pickadate({
today: t,
format: f,
clear: false,
min: min,
max: max,
selectYears: sy,
selectMonths: sm,
firstDay: fd,
formatSubmit: f2,
hiddenSuffix: s,
onClose: function() {
var $this = ?; // <-- How do I define $this?
$this.fadeOut();
}
});