views:

165

answers:

2

My problem is this: I need to update some text in a div with the value of what the mouse pointer is hovering over in the autocomplete drop down list.

Can it be done easily, or do I have to make fundamental changes to the Autocomplete plugin?

I am using the jQuery Autocomplete plugin version 1.1 by Jörn Zaefferer.

Any and all help will be greatly appreciated!

+1  A: 

using jQuery 1.4.2 autocomplete native plugin, you can do that with this code:

$('.ui-menu-item a').live('mouseenter', function(){alert('hello!');});
Zote
That snippet didn't work for me. I tried in both FF and Safari... :(Then I played around a bit, and the following snippet does the job: $('li').live('mouseenter', function(){alert('hello!');});Yes, it does cast a wide net, but does what I need it to do. Thanks.
Tommy B
I tried here using firebug console and it works fine...
Zote
A: 

You could use jQuery live to bind to the result table that pops up, but it's non-specific, so you may have to add the live when the input field has focus, then make it die when it loses focus. Basically try this (console.debug is to print out the result in the Firebug console):

$('.ac_results li').live('mouseover',function(){
 console.debug( $(this).html() );  // current autocomplete result list being hovered over
})
fudgey
Works like a charm!
Tommy B