如何在 IE 6 上将 JQuery UI 日期选择器与 bgIframe 结合使用
我正在尝试在 IE6 网站上使用 JQuery UI datepicker(最新稳定版本 1.5.2)。 但我在 IE6 上遇到了组合框(选择)的常见问题,它们浮在其他控件之上。 我在声明日期选择器后尝试添加 bgIframe 插件,但没有成功。
我的猜测是,在显示日历之前,我附加 bgIframe 的 .ui-datepicker-div 并不存在。
我想知道是否可以将 .bgIframe() 命令直接放入 datepicker .js 文件中,如果可以,在哪里? (kelvin Luck 的类似控件使用这种方法)
当前代码
$(".DateItem").datepicker({
showOn:"按钮",
...等等...
});
$(".ui-datepicker-div").bgIframe();
I am trying to use the JQuery UI datepicker (latest stable version 1.5.2) on an IE6 website. But I am having the usual problems with combo boxes (selects) on IE6 where they float above other controls. I have tried adding the bgIframe plugin after declaring the datepicker with no luck.
My guess is that the .ui-datepicker-div to which I am attaching the bgIframe doesn't exist until the calendar is shown.
I am wondering if I can put the .bgIframe() command directly into the datepicker .js file and if so, where? (the similar control by kelvin Luck uses this approach)
Current code
$(".DateItem").datepicker({
showOn:"button",
... etc ...
});
$(".ui-datepicker-div").bgIframe();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
默认情况下应该为您处理好这一点。
iframe 默认包含在 IE6 的日期选择器中。 它的样式称为 ui-datepicker-cover ,用于处理透明度。 唯一一次不是这种情况的是旧的 themeroller 代码中没有样式。
This should be taken care of for you by default.
The iframe gets included by default in IE6 in the datepicker. The style for it, called ui-datepicker-cover that handles the transparency. The only time this isn't the case is in the old themeroller code the style wasn't in there.
我也因为这个问题非常担心。
解决方案变成如下。
I worried very much due to the problem, too.
The solution becomes the following.
我已经注意到 Marc 的评论,即 ui-datepicker-cover 样式应该处理这个问题。 就我而言,日历的右边缘和下边缘仍然会显示下拉菜单。
看起来 iFrame 的大小最初是由
postProcess 函数中的以下代码行设置的。
然后每次日期更改时都会重置此大小
我简单的解决方案是删除这两套代码并修复 .css 文件中封面样式的大小
in css file set the width of .ui-datepicker-封面为 220px,高度为 200px
Steve
I have noted Marc's comment that the ui-datepicker-cover style should handle this. In my case the right and bottom edges of the calendar would still show drop downs through them.
It looks like the size of the iFrame is initially being set by the following lines of code
in the postProcess function.
This size is then reset each time the date is changed by the line
My simplistic solution was to remove these two sets of code and fix the size of the cover style in the .css file
in css file set the width of .ui-datepicker-cover to 220px, height to 200px
Steve
我有类似的东西并使用 bgIframe 插件,只需将
bgiframe();
函数放在onBeforeShow()
datepicker 的方法中检查它
i had something like this and to use the bgIframe plugin, just i put the
bgiframe();
function insideonBeforeShow()
datepicker's methodcheck it