I would not use the javascript in that example, it's a simple example to get you up and going. I have accomplished this with haystack, but used jQuery UI's Autocomplete widget instead - it will automatically position itself correctly below the input box you have attached it to:
http://jqueryui.com/autocomplete/
Also worth checking out is Twitter's new autocomplete widget:
http://twitter.github.io/typeahead.js/
However if you want to use the javascript in the haystack example, then you need to apply some CSS, e.g.
.ac-results {
position: absolute;
top: 40px;
left: 600px;
width: 150px;
}
You'd obviously have to tweak the pixels accordingly. Also, the HTML should be changed to using UL list and LI list items to make this easier to style. Again, save yourself a headache and try a library that provides an autocomplete widget where you basically just tell it which input element you want to provide suggestions for and plugin the URL to your django ajax endpoint. Good luck.