Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var datesW=$('#dates').width();
- console.log(datesW);
- $('#dates.ui-datepicker').attr('style', 'width: '+datesW+'px !important');
- $("input.hasDatepicker").click(function () {
- $("#ui-datepicker-div")
- // BTW, min-width is better:
- //.css("min-width", $(this).outerWidth() + "px");
- .css("width", $(this).outerWidth() + "px");
- });
- $("#dates").datepicker({
- beforeShow: function(input, inst) {
- setTimeout(function(){
- var datesW=$('#dates').width();
- console.log(datesW);
- $('#dates.ui-datepicker').css('width',datesW+'px');
- },0);
- }
- });
- .ui-datepicker{
- font-size:12px; //Or adjust it if it is still too large or small
- }
- `$('#datepicker').datepicker({
- beforeShow: function (input, inst) {
- setTimeout(function(){
- inst.dpDiv.outerWidth($(input).outerWidth());
- },0);
- },
- })`
Add Comment
Please, Sign In to add comment