move the position of bootstrap datepicker

前端 未结 5 2067
無奈伤痛
無奈伤痛 2021-01-18 10:21

Can I able to move the datepicker near the calender icon ??? Any fix for this would be appreciated. datepicker is generated dynamically.

I ha

5条回答
  •  暖寄归人
    2021-01-18 10:40

    The 'container' option available in the plugin might come in handy. You can use CSS to position the calendar wherever you need it. Here is an example I have created on jsFiddle.

    https://jsfiddle.net/giri_jeedigunta/6patf4L5/

    HTML:

    JS:

    $('.datepicker').datepicker({
      container: '#custom-pos'
    });
    

    CSS:

    #custom-pos {
      position: relative;
      right: -70px;
    }
    .dropdown-menu {
       left: auto !important;
    }
    

提交回复
热议问题