I have a slideshow div, and I have a datepicker field above that div.
When I click in the datepicker field, the datepicker panel show behind slideshow div.
I have a dialog box that uses the datepicker on it. It was always hidden. When I adjusted the z-index, the field on the lower form always showed up on the dialog.
I used a combination of solutions that I saw to resolve the issue.
$('.ui-datepicker', $form).datepicker({
showButtonPanel: true,
changeMonth: true,
changeYear: true,
dateFormat: "yy-M-dd",
beforeShow: function (input) {
$(input).css({
"position": "relative",
"z-index": 999999
});
},
onClose: function () { $('.ui-datepicker').css({ 'z-index': 0 } ); }
});
The before show ensures that datepicker always is on top when selected, but the onClose ensures that the z-index of the field gets reset so that it doesn't overlap on any dialogs opened later with a different datepicker.