更新到最新的JQuery UI和datepicker导致始终显示datepicker [英] Updating to latest JQuery UI and datepicker is causing the datepicker to always be seen

查看:83
本文介绍了更新到最新的JQuery UI和datepicker导致始终显示datepicker的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们刚刚更新到JQuery 1.5.2.min和JQuery-ui-1.8.11.min,并且也在使用最新的datepicker.js文件(我说这些文件是因为我们正在使用某些本地化版本的日期选择器).

We have just updated to JQuery 1.5.2.min and JQuery-ui-1.8.11.min and are using the latest datepicker.js files as well (I say files because we are using some of the localized versions of the datepicker also).

在更新之前,我们使用以下代码初始化并使用日期选择器并设置语言环境

Before we updated we used the following code to initialize and use the datepicker and set the locale

$.datepicker.setDefaults($.datepicker.regional['']);

$('.datepicker').keypress(function()
{
    $(this).datepicker('hide');
});

$('.datepicker').datepicker();
$('.datepicker').datepicker('option', $.datepicker.regional[widgetCulture]);
$('.datepicker').datepicker('option', 'showAnim', '');
$('.datepicker').datepicker('setDate', new Date());

自更新以来,当滚动到使用日期选择器的屏幕底部时,您可以在所有控件下方看到它.它只是漂浮在那里!一旦您单击了与日期选择器关联的字段,它就会出现在应该显示的位置,然后在刷新页面之前不会再次出现在屏幕底部.当我注释掉.datepicker()行以外的所有内容时,我看到的是一个灰色的条,而不是整个日历,这有点​​好,我想(不是真的),但仍然需要修复.上面代码的任何其他行都将显示整个日历.这真令人沮丧!

Since the update, when you scroll to the bottom of the screen where the datepicker is used, you can see it below all the controls. Its just floating there! Once you click on a field that the datepicker is associated with, it appears where it should and then does not appear at the bottom of the screen again until you refresh the page. When I comment out everything but the .datepicker() line all I see is a grey bar instead of the entire calendar which is a tad better, I suppose (not really), but still needs to be fixed. Any other line of the above code makes the entire calendar appear. This is severely frustrating!

有人可以阐明这一点吗?

Can someone please shed some light on this?

推荐答案

我已经有相同的bug一段时间了,今晚才去看看它.我不确定为什么会发生此错误,但是以下是我为消除屏幕上的视觉瑕疵而采取的措施.创建日期选择器之后,立即执行以下操作:

I've had this same bug for a while and just got around to looking at it tonight. I'm not sure why this bug occurs, but the following is what I've done to eliminate the visual artifact on the screen. Right after you create your datepicker(s), execute the following:

$('#ui-datepicker-div').css('display','none');

注意:当我查看由Safari生成的dom,并逐步执行创建日期选择器的代码时,上面的代码似乎对dom没有任何作用,但它确实隐藏了屏幕上的视觉效果.

Caveat: When I look at the dom generated by Safari and step through the code that creates the datepicker, the code above appears to do nothing to the dom, but it does hide the visual affect on the screen.

这篇关于更新到最新的JQuery UI和datepicker导致始终显示datepicker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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