问题描述
Datepicker的一个实例在一个奇怪的地方显示为页面。
我正在使用一个页面上都有jQuery UI的Datepicker和Accordion。在用于UI的CSS中,Datepicker的显示:none
似乎被显示:block
覆盖手风琴,至少根据Firebug(见下面的img)。
然后,一旦在餐饮/活动室标签中点击了Datepicker触发器(点击其中一个按钮显示带有Datepicker的div,)显示:none
似乎可以工作。
这是坏的div看起来像:
这里是Firebug面板:
我有同样的问题,而上述一些解决方案可以工作,最简单所有的修复都是将其添加到您的css中:
#ui-datepicker-div {display:none;}
这基本上隐藏了重新排列的datepicker元素,当它不能是bi嵌入现有的不可见元素。您隐藏它,但是当您单击需要显示datepicker的元素时,它将被重新初始化。重新初始化后,id #ui-datepicker-div
的datepicker元素将具有正确的位置。
Something strange afoot, here:
An instance of Datepicker is showing up in a weird place as a single bar in the upper left hand corner of this page.
I'm using both jQuery UI's Datepicker and Accordion on a page. In the CSS for the UI, the display:none
for Datepicker seems to be overridden by the display:block
for the Accordion, at least according to Firebug (see img below).
Then, once the Datepicker trigger is clicked in the 'catering/event room' tab (click one of the buttons to show div with Datepicker,) the display:none
seems to then work.
Here's what the bad div looks like:
and here's the Firebug panel:
I had the same problem and while some of the above solutions work, the easiest fix of all is to add this to your css:
#ui-datepicker-div {display: none;}
This basically hides the realigned datepicker element when it cannot be binded to an existing invisible element. You hide it, but it will be initialized again when you click on an element that needs to display the datepicker. Upon re-initialization, the datepicker element with id #ui-datepicker-div
will have the correct position.
这篇关于覆盖jQuery UI Datepicker div可见奇怪地在第一页加载。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!