Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

customizing the drop down autocomplete box

I'm using jquerys autocomplete widget but I'm having a few issues trying to style the box that drop down when you search for something.

I'm trying to move the box down a bit and change the border/bg color but some JS is adding in some embedded styles which are overriding my .css styles. But I can't find it.

I'v based mine off this one.

<ul class="ui-autocomplete ui-menu ui-widget-content" role="listbox" aria-activedescendant="ui-active-menuitem" style="z-index: 11; display: block; width: 139px; top: 44px; left: 1101px; "><li class="ui-menu-item" role="menuitem">
like image 812
Syntax Avatar asked Dec 06 '11 03:12

Syntax


1 Answers

In order to avoid using !important you could add your styles with jQuery and override them in that way.

$('ul.ui-autocomplete').css({
    color: 'red'
});

Another solution would be to remove the style attribute from the ul.

$('ul.ui-autocomplete').removeAttr('style');
like image 140
Filip Avatar answered Sep 23 '22 17:09

Filip