覆盖jQuery UI Datepicker div在第一页加载时可见奇怪。 [英] Override jQuery UI Datepicker div visible strangely on first page load.

查看:132
本文介绍了覆盖jQuery UI Datepicker div在第一页加载时可见奇怪。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一些奇怪的事情,在这里:

Something strange afoot, here:

Datepicker的一个实例显示在一个奇怪的地方作为一个单一的栏,在页面。

An instance of Datepicker is showing up in a weird place as a single bar in the upper left hand corner of this page.

我在页面上使用jQuery UI的Datepicker和Accordion。在UI的CSS中,Datepicker的 display:none 似乎被 display:block 手风琴,至少根据Firebug(见下面的img)。

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).

然后,一旦在饮食/活动室选项卡中点击Datepicker触发器按钮显示div与Datepicker,) display:none 似乎工作。

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.

看起来像:

这里是Firebug面板:

and here's the Firebug panel:

推荐答案

我有同样的问题,虽然一些上述解决方案工作,修复所有是将它添加到您的css:

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;}

当它不能绑定到现有的不可见元素时,这基本上隐藏了重新对齐的datepicker元素。您可以隐藏它,但是当您单击需要显示日期选择器的元素时,它将再次初始化。重新初始化后,id #ui-datepicker-div 的datepicker元素将具有正确的位置。

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在第一页加载时可见奇怪。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆