meena
meena

Reputation: 245

How to change the position of date picker in textbox in JQuery

How to change the position of date picker in text box using JQuery

<input type="text" id="Date" name="Date" class='Date'/>   

Jquery

 <script type="text/javascript">
 (function ($) {
        $('.Date').datepicker();
        $('.Date').datepicker('setDate', 'today');
    })(jQuery);
</script>

Here how to change the position of date picker down to left side and How to Decrease the height and width in this

Upvotes: 2

Views: 461

Answers (1)

Hoja
Hoja

Reputation: 1207

Try this

  $('.Date').datepicker({
        beforeShow: function(input, inst)
        {
            inst.dpDiv.css({marginTop: -input.offsetHeight + 'px', marginLeft: input.offsetWidth + 'px'});
        }
    });

Upvotes: 1

Related Questions