Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery-UI's autocomplete not display well, z-index issue

I'm currently implementing jQuery UI's autocomplete in my clients webshop. The problem is: the element the autocomplete resides in, has a higher z-index then the z-index of the autocomplete. I tried setting the autocomplete z-index manually, but I've got the feeling that jQuery UI is overwriting this.

In fact my question is a duplicate of autocomplete suggestion list wrong z-index, how can i change?, but since there was no answer I thought about giving it another try.

Any help is welcome!

Martijn

like image 616
Martijn Avatar asked Jul 20 '11 12:07

Martijn


3 Answers

Use z-index and !important

.ui-autocomplete { position: absolute; cursor: default;z-index:30 !important;}  
like image 146
Ranch Avatar answered Sep 20 '22 12:09

Ranch


While searching I found this topic (http://forum.jquery.com/topic/alternating-style-on-autocomplete). Apparently the only way to change the style of the autocomplete box is by doing it through javascript:

    open: function(){
        $(this).autocomplete('widget').css('z-index', 100);
        return false;
    },
like image 27
Martijn Avatar answered Sep 21 '22 12:09

Martijn


Change the z-index of the parent Div, the autocomplete menu will have the div's z-index+1

like image 40
Gratian Avatar answered Sep 24 '22 12:09

Gratian