views:

10

answers:

1

I am using the jquery ui datepicker inline mode view

I want to be able to capture when a user clicks on the month name at the top (as i then want to zoom into a more detailed month view.

is this possible to capture this click event?

+1  A: 

The element has a ui-datepicker-month class, so you can just do this:

$(".ui-datepicker-month").live("click", function() {
  //do stuff
});

You can give it a try here, keep in mind this is only the month, change the selector to this if you want to include clicks on the year as well: ".ui-datepicker-month, .ui-datepicker-year".

Nick Craver
@Nick Craver - how can you get which month you clicked (as i am showing multiple months)
ooo
@ooo - You can use `$(this).text()` to get the label, or are you after something else?
Nick Craver
@Nick Craver - for month and year, you can also use ".ui-datepicker-title"
ooo