简体   繁体   English

jQuery日期时间选择器布局格式问题

[英]JQuery date time picker layout format issue

I am jquery for date time picker. 我是日期时间选择器的jQuery。 Its working fine but , previous month or next month icon is not displying as shown in image.. but its also working when i click on the pictureless area. 它的工作正常,但是,上个月或下个月的图标没有显示,如图所示。但是当我单击无图片区域时,它也可以工作。

I need to show the image at the corners as shown in image . 我需要在图像的角落显示图像。 please suggest where the problem is.. 请提出问题所在。

I downloaded from http://trentrichardson.com/examples/timepicker/ 我从http://trentrichardson.com/examples/timepicker/下载

在此处输入图片说明 My Code : 我的代码:

          <link rel="stylesheet" href="css/jquery-ui.css">
   <style>
   /* css for timepicker */
.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
.ui-timepicker-div dl { text-align: left; }
.ui-timepicker-div dl dt { float: left; clear:left; padding: 0 0 0 5px; }
.ui-timepicker-div dl dd { margin: 0 10px 10px 45%; }
.ui-timepicker-div td { font-size: 90%; }
.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }

.ui-timepicker-rtl{ direction: rtl; }
.ui-timepicker-rtl dl { text-align: right; padding: 0 5px 0 0; }
.ui-timepicker-rtl dl dt{ float: right; clear: right; }
.ui-timepicker-rtl dl dd { margin: 0 45% 10px 10px; }
   </style>

    <script src="js/jquery-1.9.1.js"></script>
            <script src="js/1.10.3/jquery-ui.js"></script>
        <script src="js/jquery-ui-timepicker-addon.js"></script>           
            <script>

 $(function() {


    $( "#datepicker" ).datetimepicker({dateFormat: "yy-mm-dd"});
  });

  </script>

Chances are you forgot to include the jQuery UI image resources. 您有可能忘记包含jQuery UI图像资源。 Open up your browsers dev tools, go to the console, and (at least in Chrome) you should see 404 error messages about missing resources. 打开您的浏览器开发工具,转到控制台,并且(至少在Chrome中是)您应该看到有关缺少资源的404错误消息。

You should download the full jQuery UI package from here: http://jqueryui.com/download/ 您应该从此处下载完整的jQuery UI包: http : //jqueryui.com/download/

Note also that besides the icons, you're not seeing the gradient backgrounds on the individual dates or in the header. 还要注意,除了图标以外,您在各个日期或标题中都看不到渐变背景。

In my case, the problem was because of wrong font Awesome classes. 就我而言,问题是由于Awesome字体类错误。 As I checked the .js files related to my datepicker, I found the arrows like: 当我检查与日期选择器相关的.js文件时,发现了如下箭头:

<i class="icon-circle-arrow-left"></i>

and

<i class="icon-circle-arrow-right"></i>

They should be changed to: 它们应更改为:

<i class="fa fa-arrow-circle-left" aria-hidden="true"></i>

and

<i class="fa fa-arrow-circle-right" aria-hidden="true"></i>

So, just find them and replace all of them to the correct ones. 因此,只需找到它们并将它们全部替换为正确的。 Wish it works for you too. 希望它也对您有用。

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

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