Why does a datepicker created on a detached div have zero height in Chrome?
When creating a jQuery UI datepicker on a detached div it works fine in Firefox but in Chrome it gets zero height.
$('<div/>').datepicker().appendTo('#some-element');
When attaching the div to the document first it works fine:
$('<div/>').appendTo('#some-element').datepicker();
However, since the actual code is not that simple (lots of legacy开发者_如何学编程 code, so attaching the div before creating its contents is difficult) I'm looking for a solution where the datepicker works even when created on a detached div.
Demo: http://jsfiddle.net/ThiefMaster/ZM95R/
This bug has been fixed
http://bugs.jqueryui.com/ticket/7552
and will be in the 1.8.15 release of jQuery UI
精彩评论