daterangepicker时间控件向上打开

今天搞个页面,刚好时间控件在页面底部,控件向下打开时把页面撑大了,效果有点爆炸。。。

然后就是百度、谷歌一通好找。。。

有说 pickerPosition: 'top-right' 的,

有说加 opens: 'top' 的,

也有说 orientation:'top' 的,

然而,都不行。

后来不知道怎么百度到的,有一个老哥说 drops: "up",

抱着试一试的心态贴上去,

还真行。。。

        $('#boxDataCode').daterangepicker({
            singleDatePicker: true,
            showWeekNumbers: true,
            //pickerPosition: 'top-right',
            //opens: 'top',
            //orientation:'top',
            drops: "up",
            locale: {
                firstDay: 1
            }    
        }, function (start) {
            var years = (start._d.getFullYear() + '').substring(2);
            var week = getweek(start.format('YYYY-MM-DD'));
            $('#boxDataCode').val(years + week);
        });

效果如图

猜你喜欢

转载自blog.csdn.net/u012835032/article/details/108265037