【问题标题】:jquery datepicker enlarge textareajquery datepicker放大文本区域
【发布时间】:2016-01-21 13:46:29
【问题描述】:

Cant embed pictures, but this picture shows my problem

我正在尝试更改处理 jquery datepicker 日期的 textarea 的大小。但是我似乎找不到我应该这样做的地方。 在我尝试了一切之后,我清除了浏览器的缓存,并且我还使用了不同的浏览器。他们都在中途取消了日期。

这是我在我的文件中找到的关于日期选择器的代码:

$( ".datepicker" ).datepicker({ 
defaultDate: +7,
autoSize: true,
dateFormat: 'yy-mm-dd',
}); 

.datepicker { width: 56px!important; }
.ui-datepicker { width: 17em; padding: .2em .2em 0; border: 1px solid #d5d5d5; background: #fafafa; margin-top: 1px; z-index: 3; display: none; }
.ui-datepicker-append { margin-left: 10px; }
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; border: 1px solid #E7E7E7; background: url(../images/leftNavBg.png) repeat-x; }
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
.ui-datepicker .ui-datepicker-prev { left:2px; }
.ui-datepicker .ui-datepicker-next { right:2px; }
.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
.ui-datepicker .ui-datepicker-next-hover { right:1px; }
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker 
.ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px;  }
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
.ui-datepicker select.ui-datepicker-month, 
.ui-datepicker select.ui-datepicker-year { width: 49%;}
.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
.ui-datepicker table .ui-state-default { border: 1px solid #d5d5d5; }
.ui-datepicker table tbody { font-size: 11px; }
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0;  }
.ui-datepicker td { border: 0; padding: 1px; }
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }

这就是我使用它的方式:

<input type='text' class='datepicker' class='topDir' title='Markera om leadet får finnas i NIXdatabasen' name='createdhigh' id='createdhigh' value='' tabindex='15' style='width: 200px;'/>

我尝试将 autosize 设置为 false,但没有任何反应。我还尝试将这两行的值设置得更高,但没有成功:

.datepicker { width: 56px!important; }
.ui-datepicker { width: 17em;

谁能帮我扩大文本区域?

【问题讨论】:

  • .datepicker { 宽度:56px!重要; }......改变这里

标签: javascript jquery html datepicker


【解决方案1】:

使用内联样式或 css 就足够了,在你的输入标签中你使用 class= 两次,你应该将它们合并到一个单一的类属性中:

<input type='text' class='datepicker topDir' title='Markera om leadet får finnas i NIXdatabasen' name='createdhigh' id='createdhigh' value='' tabindex='15' style='width: 200px;'/>

Alsp 检查您的“topDir”是否没有将宽度设置为“!important”,或者页面中是否有足够的空间来容纳更大的输入。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多