更改jQuery UI Datepicker的位置 [英] change the position of jQuery UI Datepicker

查看:182
本文介绍了更改jQuery UI Datepicker的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用jQuery UI Datepicker。

I am using the jQuery UI Datepicker.

但是垂直CSS滚动条 overflow-y:scroll

However a vertical CSS scrollbar overflow-y:scroll causes a bug for Firefox, Opera and Safari.

通过复制jqueryUI的示例代码并添加2行css声明可以轻松地复制此错误:

This bug can easily be reproduced by copying the sample code of jqueryUI and adding 2 lines css declarations:

 body { overflow:scroll }
 #datepicker{ position:absolute; right:1px }

可以看到演示 此处(jsbin)。要查看错误点击位于右上角的文本框)

A demo can be seen here (jsbin). To see the bug click at the textbox located on the upper right corner)

根据jQuery团队,这个错误将不会被修复,因为正文是自定义的。

According to the jQuery team this bug will not be fixed as the body is customized.

以前有人遇到过这个问题吗?

Has someone been faced with this problem before?

有没有解决方案来解决这个问题?

Is there any solution to solve this issue?

编辑:

如截图所示,它截取了日历的一部分:

As seen in this screenshot it cuts a part of the calendar:

alt text http://i37.tinypic.com/21awbo0.jpg

感谢
Jan

Thanks Jan

推荐答案

但它可以工作,你可以检查用户的浏览器:

However it works and you might check for the users browser:

$("#ui-datepicker-div").wrap('<div style="position:absolute;left:-2em;top:-1em"></div>');

这篇关于更改jQuery UI Datepicker的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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