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

前端 未结 12 1059
情深已故
情深已故 2021-01-31 12:54

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 th

相关标签:
12条回答
  • 2021-01-31 13:44

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

    0 讨论(0)
  • 2021-01-31 13:47

    If you are using jquery-ui dialogs be careful to initialize the dialogs BEFORE the autocomplete or the autocomplete will be shown under the dialog.

    Look at this answer jquery UI autocomplete inside a modal ui dialog - suggestions not showing?

    0 讨论(0)
  • 2021-01-31 13:52

    Use z-index and !important

    .ui-autocomplete { position: absolute; cursor: default;z-index:30 !important;}  
    
    0 讨论(0)
  • 2021-01-31 13:54
    open: function () {
        $(this).autocomplete('widget').zIndex(10);
    }
    
    0 讨论(0)
  • 2021-01-31 13:54

    For those developers that still use this plugin. Try this:

    .acResults
    {
        z-index:1;
    }
    

    For me was enough with z-index:1, set the value you need in your case.

    0 讨论(0)
  • 2021-01-31 13:56

    also have a look at where you are appending the item to. i came across this problem when i appended the autocomplete to an inner div, but when i appended the autocomplete to the body tag, the problem went away.

    0 讨论(0)
提交回复
热议问题