对Jquery UI主题的图标使用JQuery UI Datepicker [英] Use JQuery UI Datepicker with Icons from Jquery UI Theme

查看:330
本文介绍了对Jquery UI主题的图标使用JQuery UI Datepicker的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用JQuery UI的日期控件设置,我也使用JQuery UI主题,它提供了一堆我想使用的默认图标。

I have a datepicker control setup using the JQuery UI, I am also using the JQuery UI themes which provide a bunch of default icons that I want to use.

DatePicker允许指定特定的图像,即:

The DatePicker allows for specifying a specific image, i.e.:

<script type="text/javascript">
  $(document).ready(function() {
    $("#DateFrom").datepicker({ showOn: 'button', buttonImageOnly: true, buttonImage: 'images/ui-icon-calendar.png' });
  });
</script>  

要显示图标集中的图标,请使用以下格式:

To display an icon from the icon set you use something like:

<span class="ui-icon ui-icon-calendar"></span>

是否容易集成两个或者我只需要手动修改样式/ ?

Is there an easy to integrate the two or do I just need to hack out the styles/images manually?

推荐答案

恐怕你必须手动做。默认情况下,Datepicker插件使用以下HTML插入指定的 buttonImage

I'm afraid you'll have to do that manually. By default, the Datepicker plugin uses the following HTML to insert the specified buttonImage:

<img title="..." alt="..." src="images/ui-icon-calendar.png" class="ui-datepicker-trigger">

顺便说一句,你可能想使用...

By the way, you might want to use...

$(function() {
 // your code here
});

...而不是...

...instead of...

$(document).ready(function() {
 // your code here
});

这篇关于对Jquery UI主题的图标使用JQuery UI Datepicker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆