时间选择器未正确放置在文本框上的jquery

时间:2014-02-13 11:52:15

标签: javascript jquery css jquery-ui datetimepicker

我需要在每天都存储所有事件,事件时间由对话框div捕获,我得到每天每个事件的开始时间和结束时间,但现在问题是

    1. Time picker is not placed at the correct text box its automatically changed please some one help me.
    2. I need to show time range i.e given gap for each and every events at half hour please help me friends.

此链接中的我的代码

http://jsbin.com/lixig/3/edit

1 个答案:

答案 0 :(得分:2)

试试这个,

if ((self.offset().top + self.outerHeight(true) + list.outerHeight()) > $(window).height() + $(window).scrollTop()) {
    // position the dropdown on top
    list.offset({
        'left': self.offset().left+self.width() ,
        'top': self.offset().top - list.height()+ self.innerHeight()
    });
} else {
    // put it under the input
    list.offset({
        'left':self.offset().left +self.width(),
        'top': self.offset().top
    });
}

Working Demo