jQuery UI datepicker性能 [英] jQuery UI datepicker performance
问题描述
我的网页上有一个文本框,用于指定日期,因此我想使用 jQuery DatePicker .但是,我的大多数用户都被限制使用IE6,并且在此浏览器中jQuery DatePicker的性能有点慢.
I have a textbox on my web page that is used to specify a date, so I'd like to use the jQuery DatePicker. However, most of my users are locked into using IE6 and the performance of the jQuery DatePicker is a little sluggish in this browser.
任何人都可以推荐替代的JavaScript日期选择器,或以任何方式改善jQuery DatePicker的显示性能吗?
Can anyone recommend an alternate JavaScript date picker, or any means of improving the display performance of the jQuery DatePicker?
推荐答案
我也遇到了这个问题.以下几项可以帮助提高IE6的性能:
I also ran into this problem. Here are a couple of things that can help performance in IE6:
-
打开背景图像缓存.这将在显示日期选择器之前加载图像:
Turn on background image caching. This will load images before the datepicker is shown:
try {
document.execCommand("BackgroundImageCache", false, true);
} catch(exception) {
// other browsers do nothing
}
关闭动画.事情看起来不太好,但是性能才是最重要的:
Turn off animations. Things won't look as nice, but performance is what matters:
$("#datepicker").datepicker( { showAnim: '' });
这些似乎对我有所帮助.您可能还可以进行其他一些小的调整.
These seemed to help a bit for me. There may be other small tweaks you can do also.
这篇关于jQuery UI datepicker性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!