JQuery UI Datepicker之前添加代码 - 弄乱布局

时间:2010-10-27 15:14:34

标签: jquery html jquery-ui

我正在使用JQuery UI进行各种操作,其中一个是datepicker。我注意到它在我的页面末尾添加了这个div:

<div class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible" id="ui-datepicker-div"></div>

就在</body>标记之前。在我的页脚之后页面底部留下40px-ish的间隙。

我有什么想法可以摆脱这个?

谢谢!

2 个答案:

答案 0 :(得分:2)

这是一个容器,用于在显示窗口小部件时保存窗口小部件的HTML。当日期选择器不可见时,容器应完全不可见。如果你玩过主题的CSS,请尝试恢复它:

/* Layout helpers
----------------------------------*/
.ui-helper-hidden { display: none; }
.ui-helper-hidden-accessible { position: absolute; left: -99999999px; }
.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
.ui-helper-clearfix { display: inline-block; }
/* required comment for clearfix to work in Opera \*/
* html .ui-helper-clearfix { height:1%; }
.ui-helper-clearfix { display:block; }
/* end clearfix */
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }

http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.3/themes/base/jquery-ui.css

答案 1 :(得分:0)

当我在同一页面上有多个带有各种css文件的插件时,我遇到了同样的问题。我无法添加布局助手css,因为它已经包含在内,所以添加它没有帮助。

相反,我只是这样做了:

$('#ui-datepicker-div').hide();

这是一个可怕的黑客攻击,但我希望它可以为我节省一些小时的调试时间。

相关问题