Hi Jolyon,

I believe that's exactly what I'm doing, as it works perfectly fine
for the first dropdown. It's when jQuery is told to look at HTML
gained via Ajax that I begin to see a problem, but only with mouse
gestures. The key functions work perfectly fine.

Here's the code for the first dropdown (sites), which looks at HTML
generated with the page, and the second dropdown (eaas), which looks
at Javascript written HTML.

        // Display the list of sites in a dropdown when the form field is
focused on.
        $(".activate_site_list").focus(function() {
                $("#site_list_dropdown").slideDown('fast');
        }).blur(function() {
                $("#site_list_dropdown").slideUp('fast');
        });
        // Display a nice hover colour when the sites are focused on.
        $("#site_list_dropdown").find("li").hover(function() {
                $("#site_list_dropdown").find(".hover").removeClass("hover");
                $(this).addClass("hover");
                site_selected = true;
                scrollPosSites = 256;
        },function() {
                $(this).removeClass("hover");
                site_selected = false;
                scrollPosSites = 256;
        });
        // Display the list of EAAs in a dropdown when the form field is
focused on.
        $(".activate_eaa_list").focus(function() {
                $("#eaa_list_dropdown").slideDown('fast');
        }).blur(function() {
                $("#eaa_list_dropdown").slideUp('fast');
        });
        // Display a nice hover colour when the EAAs are focused on.
        $("#eaa_list_dropdown").find("li").hover(function() {
                $("#eaa_list_dropdown").find(".hover").removeClass("hover");
                $(this).addClass("hover");
                eaaSelected = true;
                scrollPosEAAs = 256;
        },function() {
                $(this).removeClass("hover");
                eaaSelected = false;
                scrollPosEAAs = 256;
        });

On Oct 24, 4:40 pm, Jolyon Terwilliger <[EMAIL PROTECTED]> wrote:
> Hi Charles,
>
> I'm not sure exactly how your code is, but it seems like you would
> want to run the code that applies the .hover() function to the li
> items after you pull them in via each ajax request.
>
> On Oct 24, 5:26 am, Charles Sexton <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hello!
>
> > I'm using jQuery to build a form dynamically. Here's how it works:
>
> > You are presented with an input box. When you focus on the box a
> > dropdown list appears that you can click on in order to insert the
> > chosen option into the input box, or you can use the keyboard arrow
> > buttons to select your choice.
> > When you move to the next input box the page makes a call via AJAX to
> > grab information for the input box based on the previous selection.
>
> > The problem is that the ".hover()" function doesn't seem to work with
> > the information that has been pulled into the document using jQuery
> > (it works fine with the first list). The items that are pulled in are
> > all list items (<li>{name}</li>). Using keystrokes works on the items,
> > just not mouse gestures. Would this be a jQuery bug or is there
> > something I can do?
>
> > Many thanks,
>
> > Charles- Hide quoted text -
>
> - Show quoted text -

Reply via email to