【问题标题】:How to custom jquery ui datepicker trigger button inline with <input> tag如何使用 <input> 标签自定义 jquery ui datepicker 触发按钮
【发布时间】:2014-02-26 11:45:43
【问题描述】:

我在 jquery ui 版本 1.10.4 中使用 datepicker,它可以在设置选项时产生触发按钮:

    $('#datetimepicker').datepicker({
    dateFormat: 'yy-mm-dd',
    showOn: 'both',
    minDate: new Date()
});

但运行时脚本按钮出现在输入框下方。 那么,如何通过任何方法使按钮成为与输入文本框内联的按钮。

谢谢你的进步

【问题讨论】:

    标签: jquery css datepicker jquery-ui-datepicker uidatepicker


    【解决方案1】:

    试试这个,

    <p>Date: <input type="text" id="datepicker"></p>
    

    jQuery 日期选择器,

    $(function() {
        $( "#datepicker" ).datepicker({
          showOn: "button",
          buttonImage: "http://jqueryui.com/resources/demos/datepicker/images/calendar.gif",
          buttonImageOnly: true
        });
      });
    

    演示链接http://jsfiddle.net/dhana36/rt4Q7/

    【讨论】:

    • 非常感谢@dhana,非常感谢。
    猜你喜欢
    • 2023-04-09
    • 1970-01-01
    • 2012-03-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-29
    • 1970-01-01
    相关资源
    最近更新 更多