简体   繁体   English

面对日历图像的问题

[英]Facing issue with calendar image

I am using Juery Datepicker when user clicked on the image next to input textbox.当用户单击输入文本框旁边的图像时,我正在使用 Juery Datepicker。

I tried with the below code snippet to show button image and not sure image is not loading.我尝试使用以下代码片段来显示按钮图像,但不确定图像未加载。

<input id="timeFrom" type="text" class="form-control" name="timeFrom">
 timeFrom.datepicker({
                 showOn: 'button',
            buttonImage: "~/Content/images/calendar.gif",
            buttonImageOnly: true 
        });

I have placed calendar image in the same path and in UI the calendar image is not showing我已将日历图像放置在同一路径中,但在 UI 中未显示日历图像

在此处输入图片说明

Can some one please let me know how to show calendar.j有人可以让我知道如何显示 calendar.j

I think the path to your buttonImage is not good, check it.我认为你的 buttonImage 的路径不好,检查一下。

 $('#timeFrom').datepicker({ showOn: "both", buttonImage: "https://findicons.com/files/icons/99/office/128/calendar.png", buttonImageOnly: true });
 .ui-datepicker-trigger { max-width: 24px; max-height: 24px; position: relative; top: 6px; left: 6px; }
 <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css " /> <script src="http://code.jquery.com/jquery-2.1.3.js"></script> <script src="http://code.jquery.com/ui/1.11.2/jquery-ui.js"></script> <input id="timeFrom" type="text" class="form-control" name="timeFrom">

I am able to see image with the change in url and I am able to see the image我能够看到 url 更改后的图像,并且我能够看到图像

 timeFrom.datepicker({
                 showOn: 'button',
            buttonImage: "../Content/images/calendar.gif",
            buttonImageOnly: true 
        });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM