Make autocomplete window appear above accordion pane I have created a node add form using the field group module to put the form in a jQuery accordion.

I have a auto-complete field that is at the bottom of one pane so the div that appears that lets users choose from the auto-complete options is behind the pane below it as it has overflow: hidden. Here is an image of the problem:



I've fixed this behavior by changing 2 lines in autocomplete.js in the populatePopup function:

//var position = $input.position();
// changes to:
var position = $input.offset();

// and

//$input.before(this.popup);
// changes to: 
$('body').append(this.popup);


As the auto-complete div is now appended to the body it appears above everything else.

This is great but the problem is I don't want to start hacking Drupal core js files.

I could copy the whole autocomplete.js to a new file and then replace the whole thing, but really I just want to override the populatePopup function.

Is it possible to do this?

(I've tried copying the populatePopup function into my own js file but I get the error Drupal.jsAC is undefined.)
Doh - I was so close.

The answer is to simply copy the function you want to override to your own custom JS file but make sure to wrap it in a document ready function!