0

i have the common problem for jquery datepicker that is showing behind dropdown box. i also tried to apply solutions provided here:

Trouble with jQuery Dialog and Datepicker plugins

but it seems not working on my page.

i use "jquery-ui.css" and inside it, i have defined:

.ui-datepicker { 
width: 17em; 
padding: .2em .2em 0; 
z-index: 9999 !important; 
}

but still the datepicker shows behind the drop down box. when i checked my page in chrome developer's tool, i got the following:

<div id="ui-datepicker-div" class="ui-datepicker ui-widget ui-helper-clearfix
 ui-corner-all" style="position:absolute; top:160.875px; left 146px; z-index:1;">

my question is how can i know where is the correct place to modify the z-index, i believe defining it in .ui-datepicker is correct but i just dont know why it does not work.

any response will be appreciated. thank you.

Community
  • 1
  • 1
janell
  • 51
  • 1
  • 10
  • 1
    can you provide any jsfiddle or the site your testing on? – Karl Adler May 23 '13 at 06:15
  • hi, sorry, im really new to jquery/javascript/css and jsfiddle is also new to me, i'll try to research about it first and create it. i cannot provide the website because it is an internal company web app. – janell May 23 '13 at 09:16

2 Answers2

0

Try this,

#ui-datepicker-div 
{
    z-index: 99999 !important; /* use #ui-datepicker-div in place of .ui-datepicker  */
}
.dropdown-box{
   z-index: 999 !important;      
}
Rohan Kumar
  • 40,431
  • 11
  • 76
  • 106
0

Add some extra pixels for the top property of the widget. call that function in beforeshow and onclose of widget..will be something like below....

name: function(pxls){
            var widget = $(selector).datepicker("widget");

            widget.css("margin-top", function (i, v) {
                var top = parseFloat(v);
                return (top + pxls) + "px";
            });
        },

call the above function like below.

beforeShow: $.proxy(this.name, this, 4)
onClose: $.proxy(this.name, this, -4)

here 4 is just test data u have figure out how much that gonna be for u. let me know how it goes..