jQuery日期选择器不移动页面滚动 [英] jQuery Date picker not moving with page scroll

查看:174
本文介绍了jQuery日期选择器不移动页面滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用标准的jQuery UI datepicker,但是当我滚动页面时,日期选择器仍然是固定的。任何想法如何解决?

I am using the standard jQuery UI datepicker ,However when i scroll the page the date picker remains fixed . Any ideas how to solve this ?

http:// jsfiddle.net/jbK6a/3/

Regards,
Neil

Regards, Neil

推荐答案

问题是datepicker在外部 div overflow:scroll; 。如果datepicker在容器内部生成,这不会是一个问题。

The problem is that the datepicker is outside the div with overflow: scroll;. If the datepicker was generated inside the container this wouldn't be a problem.

解决方案: http://jsfiddle.net/jbK6a/15/

我将datepicker放在输入后面的 beforeShow 事件。

I placed the datepicker behind the input with the beforeShow event.

我在可滚动容器上使用了 position:relative; 绝对元素侦听容器。

And I used position: relative; on the scrollable container so that de absolute element listens to the container.

这篇关于jQuery日期选择器不移动页面滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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