jQuery UI Datepicker位置底部或顶部,但不是两者 [英] jQuery UI Datepicker position bottom or top but not both
问题描述
我正在使用Datepicker插件,并根据需要进行自定义。我能够做大部分我需要的CSS,但是有一件事让我烦恼。当日历根据屏幕上的位置打开时,它将显示在输入的顶部或底部。我该如何控制这种行为?我正在努力适应一个响应式的布局,所以有时候我希望在顶部和其他时候我想要它,但不是两者。
I'm using the Datepicker plugin and customizing it to my needs. I was able to do mostly everything I needed in CSS but there's one thing that is bothering me. When the calendar opens depending on where you are on your screen it will appear on top or under the input. How can I have control over this behavior? I'm trying to adapt it to a responsive layout so sometimes I want it on top and other times I want it under but not both.
推荐答案
Datepicker调用 $。datepicker._checkOffset
来计算位置。
Datepicker calls $.datepicker._checkOffset
to calculate the position.
我将抓住原来的功能(从 here ),并根据我的需要重新定义。
I would grab the original function (from here) and redefine it according to my needs.
这篇关于jQuery UI Datepicker位置底部或顶部,但不是两者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!