jQuery datePicker [英] Jquery datePicker
问题描述
我对jquery datepicker有一点问题,因为它显示在目标框上方.这是由于我的页面设置方式所致.我通过萤火虫在页面中发现了CSS的问题,不幸的是,它与大约20个元素冲突.
I have slight issue with the jquery datepicker in that it displays ABOVE the target box. This is due to the way my page is set up. I found the issue with CSS in my page via firebug, unfortunately it conflicts with about 20 elements.
接下来,我尝试连接到有效的"beforeShow事件",但是在事件触发后,它只是重新计算并将其放置在所需的位置.
Next I tried hooking into the "beforeShow event" which works but then after the event fires it just recalculates and puts it where ever it wants.
beforeShow: function() {
$('#ui-datepicker-div').show();
var offset = $('#ui-datepicker-div').offset();
$('#ui-datepicker-div').css({
top: (offset.top + 222) + 'px'
})
}
其他人对我如何重新定位有任何想法吗?我只需要将其向下移动约200个奇数像素即可.
Does anyone else have any ideas how how I can reposition this? I just need to move it down by about 200 odd pixels.
推荐答案
覆盖_showDatepicker函数似乎可行:
Overriding the _showDatepicker function seems to work:
(function() {
var orig = jQuery.datepicker._showDatepicker;
jQuery.datepicker._showDatepicker = function(input){
orig.apply(this, arguments);
$('#ui-datepicker-div').css('top', '100px');
}
})();
这篇关于jQuery datePicker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!