jQuery UI datepicker onSelect bubbling
I'm using the "onSelect" setting of the jQuery UI datepicker. Unfortunately I have two calendars where the user needs to select the date on each one AND I also need the calendars to hide if the user clicks on the pag开发者_JAVA技巧e. So, I attached a click event to the HTML tag that hides the calendar. The problem is that when I use the "onSelect" method of the datepicker, that also triggers the click event on the HTML tag and hides the calendar!
Any ideas?
if ($(event.target).closest(".ui-datepicker").size() === 0) {
// No date picker was clicked!
}
精彩评论