search, type ahead and mouse overs
Posted: Sun Jun 25, 2006 8:53 am
I have a text field that I have a need to add typeahead. The typeahead results are either returned via ajax or javascript, doesnt actually matter. Currently the results appear below the text field in nice shiny divs, the user can choose one using their arrowkeys and enter etc. I would like to take the final and frankly obvious step which is to put a mouseon/mouseover function to each of the divs.
Now I get the most retarded results I have ever seen if I put an ele.onmousedown on the created div: it triggers when the parent div (the div that contains the results) is populate and not when someone actually clicks on any of the elements......this is in ie. I've read a bunch over complicated and seemingly incomprehensible garbage about listeners and I'm confused as hell. On one side it takes all of 1 second to figure out how to do key presses but when it comes to the mouse its not even funny how bad things are.
If you would like an idea of the functionality I'm talking about check the search feature here:
http://www.curse-gaming.com/en/
(type in hunt)
I wrote the search code eons ago but would really like this kind of interface for it, mine returns all search results to the main page content div using typeahead which is nice, but I'd like to get this working as an option for other locations on my sites.
Now I get the most retarded results I have ever seen if I put an ele.onmousedown on the created div: it triggers when the parent div (the div that contains the results) is populate and not when someone actually clicks on any of the elements......this is in ie. I've read a bunch over complicated and seemingly incomprehensible garbage about listeners and I'm confused as hell. On one side it takes all of 1 second to figure out how to do key presses but when it comes to the mouse its not even funny how bad things are.
If you would like an idea of the functionality I'm talking about check the search feature here:
http://www.curse-gaming.com/en/
(type in hunt)
I wrote the search code eons ago but would really like this kind of interface for it, mine returns all search results to the main page content div using typeahead which is nice, but I'd like to get this working as an option for other locations on my sites.