结合使用jQuery Date Picker和自定义触发按钮 [英] Using jQuery Date picker with a custom trigger button

查看:124
本文介绍了结合使用jQuery Date Picker和自定义触发按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过用户定义的按钮打开jQuery Datepicker?

How do I make the jQuery Datepicker open up by a user defined button?

推荐答案

内置支持为此,在文本框的右侧具有一个图标或按钮,如下所示:

There's built-in support for this, having an icon or button to right right of the textbox, like this:

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

如果您想通过另一个按钮显示它,或者实际上是任何事件,请调用 show方法,如下所示:

If you want to show it from another button, or really any event, call the show method, like this:

$("#myButton").click(function() {
  $("#datepicker").datepicker("show");
});

您可以在这里尝试

这篇关于结合使用jQuery Date Picker和自定义触发按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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