0

Trying to load .datepicker() inside a .dialog()

I'm doing this, but it doesn't seem to come up at all in the dialog:

 $(document).ready(function(){
    $("#ui-datepicker-div").css("z-index","9999 !important");

    // tried this too
    $(".ui-datepicker").css("z-index","9999 !important");
 });

FireBug says it's still <div id="ui-datepicker-div" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" style="position: absolute; top: 339.4px; left: 656.4px; z-index: 2; display: block;"> when loaded.

Whats wrong here? I looked at this with no help: Trouble with jQuery Dialog and Datepicker plugins

Community
  • 1
  • 1
Control Freak
  • 12,965
  • 30
  • 94
  • 145
  • Are the datepicker and dialog divs positioned? z-index only works on positioned elements (position:absolute, position:relative, or position:fixed) –  Feb 16 '12 at 18:09
  • the object is already `absolute` see update above – Control Freak Feb 16 '12 at 18:12

1 Answers1

0

console log $('#ui-datepicker-div').length it's possible it's not in the dom at the point that's run.

If that returns 0, then you'll need to move that code appropriately to after it exists in the dom.

dennmat
  • 2,618
  • 2
  • 17
  • 20