jquery datepicker动态更改位置 [英] jquery datepicker change position dynamically
本文介绍了jquery datepicker动态更改位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
但是如果一个其他datepicker(div)隐藏?
解决方案
也许在 beforeShow
event:
$(。is-datepicker)。datepicker(option,beforeShow输入,inst){
$(inst.dpDiv).position({
my:left top,
at:left bottom,
of:$(input )
});
position()$ c 1.8版中添加了$ c> http://api.jqueryui.com/position/
I use several datepickers on my page and in some cases i hide a div with one of them. After that the position of the other datepickers is not correct anymore, they are way above the input. I think that is because the place is determined on initialisation, because if i show the div again the position is correct.
But how to make the position that it changes if an other datepicker (div) hides?
解决方案
Perhaps set the position in the beforeShow
event:
$(".is-datepicker").datepicker("option", "beforeShow", function(input, inst){
$(inst.dpDiv).position({
my: "left top",
at: "left bottom",
of: $(input)
});
position()
was added in version 1.8 http://api.jqueryui.com/position/
这篇关于jquery datepicker动态更改位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文