Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/366.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 无法隐藏jquery ui的日期选择器_Javascript_Jquery Ui - Fatal编程技术网

Javascript 无法隐藏jquery ui的日期选择器

Javascript 无法隐藏jquery ui的日期选择器,javascript,jquery-ui,Javascript,Jquery Ui,有很多问题和答案,但我找不到我想要的 我正在显示带有链接单击的日期选择器,但在用户选择日期时无法隐藏它。如果你有任何建议,请告诉我。您可以在以下位置找到相关代码: 在内联detepicker上调用“hide”,即附加到输入以外的元素的日期选择器不会起任何作用。试着打电话给destroy // ... calendar.children("span").text(obj.selectedDay); $("#content").datepicker('destroy'); // ... 请提供一个

有很多问题和答案,但我找不到我想要的

我正在显示带有链接单击的日期选择器,但在用户选择日期时无法隐藏它。如果你有任何建议,请告诉我。您可以在以下位置找到相关代码:


在内联detepicker上调用“hide”,即附加到输入以外的元素的日期选择器不会起任何作用。试着打电话给destroy

// ...
calendar.children("span").text(obj.selectedDay);
$("#content").datepicker('destroy');
// ...

请提供一个JSFIDLE测试用例..嘿,Nelson,我添加了JSFIDLE链接。谢谢。我也试过这个,但奇怪的是,这个删除了$content。
// ...
calendar.children("span").text(obj.selectedDay);
$("#content").datepicker('destroy');
// ...