开发者

jQuery UI datepicker onSelect bubbling

开发者 https://www.devze.com 2023-04-10 12:44 出处:网络
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 use

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!
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号