开发者

trigger function on "gotoCurrent" with jQuery datepicker

开发者 https://www.devze.com 2023-01-24 05:17 出处:网络
I very happy using the datepicker from jQuery UI. and the onSelect: function... works perfectly. But: How do I go about triggering a function when I click the \"gotoCurrent\"-button beneath the ca

I very happy using the datepicker from jQuery UI.

and the onSelect: function... works perfectly.

But:

How do I go about triggering a function when I click the "gotoCurrent"-button beneath the calendar. As far as I can see I can only trigger on onSelect by d开发者_如何学Cefault, so I guess what I need to do is actually extend the functionality of datepicker?

Any hints on what I need to do?


$( ".selector" ).datepicker({ gotoCurrent: function(){...}; });

I believe that will work. If I understood you correctly.

Alternatively:

$('ui-datepicker-current').click(function(){
     some function

});


    $("#datepicker button.ui-datepicker-current").attr("onclick", "");
    $("#datepicker button.ui-datepicker-current").click(function() {
        //do stuff
    });

This worked. If anyone has a more beautiful solution I'd be happy to see it :-)

0

精彩评论

暂无评论...
验证码 换一张
取 消