jQuery日期选择器不移动页面滚动 [英] jQuery Date picker not moving with page scroll
问题描述
我正在使用标准的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 ?
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屋!