javascript - jquery datepicker 图标拉伸(stretch)

标签 javascript jquery html css datepicker

我似乎无法解决 jquery datepicker 图标变长的问题,它看起来像这样:

Stretched icon

当原始图标为17x17时像素,看起来像这样:

the actual png image

我通过 input 附上这张图片代码中的元素如下:

<input type="text" name="searchDate" id="searchDate" class="datePickerWithImage" cth:inputvalidate="Date" size="10" maxlength="10" tabIndex="14" title="Provide value for search date" />

还有 jquery日期选择器的功能是:

$( ".datePickerWithImage" ).datepicker({
    showOn: "button",
    showButtonPanel: true,
    buttonImage: "/images/manageschedule.png",
    dateFormat: 'yy/mm/dd',
    buttonText: "Open calendar",
    buttonImageOnly: true,
    showWeek: true,
});

它在 css 中有一些额外的渲染提示:

.ui-datepicker-trigger {
                       margin-left:2px;
                       }

我似乎无法在 jquery api 中找到任何有用的东西,它看起来很奇怪,我真的很想修复它:)

编辑:在开发人员工具中,我可以看到元素为 <div id="ui-datepicker-div" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" style="position: absolute; top: 127.909px; left: 471.349px; z-index: 2; display: none;"> .. 但不确定这到底有多大帮助..

最佳答案

在你的风格中添加这个可能对你有帮助

input[type="text"].datePickerWithImage
{
width:17px;
height:17px;
}

关于javascript - jquery datepicker 图标拉伸(stretch),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34194831/

相关文章:

php - 上传大文件时浏览器挂起

javascript - Angular ng show 不会在范围更新时更新

javascript - jquery load() 特定 div 不起作用

jquery - 为什么 Firefox 5 会忽略 document.ready?

javascript - JQuery 将 HTML 内容分配给变量

php - 通过ajax到php的多维数组通过json_decode变成null

javascript - 如何在底部导航栏中访问类的 this.state (React Native)

javascript - 如何检查ember模型是否有 key

jquery - 如何在其内部调用 jQuery 插件的方法?

javascript - React-Bootstrap Modal 表单入口