class for jquery ui datepicker button

后端 未结 2 666
野性不改
野性不改 2021-01-02 00:42

I have the following code for the jQuery UI datepicker:

$(function() {
        $(\".date\").datepicker({
            showOn: \'button\',
            buttonTe         


        
相关标签:
2条回答
  • 2021-01-02 01:19

    Make it become a jQuery UI button since you already have the framework loaded ;)

    http://www.robertmullaney.com/2011/08/26/make-jquery-datepicker-use-ui-button/

    Disclaimer: My Blog

    0 讨论(0)
  • 2021-01-02 01:20

    You can't add an additional class through an option, but it does have a class: ui-datepicker-trigger, so if you just style directly or as a descendant of an identifiable container it'll work, for example:

    .ui-datepicker-trigger { color: red; }
    //or...
    .myContainer .ui-datepicker-trigger { color: red; }
    

    Or, add a different class to the button manually after creating the datepicker (which creates the button):

    $(function() {
        $(".date").datepicker({
            showOn: 'button',
            buttonText: "Choose Date",
            dateFormat: 'yy-mm-dd'
        }).next(".ui-datepicker-trigger").addClass("someClass");
    });
    
    0 讨论(0)
提交回复
热议问题