jquery hover() is not triggered when hovered first time
<p>Menu is loaded through ajax and hover function is associated to each li using live(). But still it is not triggering for first time. From second time onwards it is triggering properly</p>

<p><strong>Main file</strong></p>

<pre><code>&lt;html&gt;
     &lt;head&gt;
        &lt;title&gt;
            test
        &lt;/title&gt;
        &lt;script type='text/javascript' src='js/jquery-1.4.2.js'&gt;
        &lt;/script&gt;
        &lt;script&gt;
            $(window).load(function() {
                jQuery(document).ready(function() {
                    jQuery('.loadm').live('click', function(event) {
                        $.ajax({
                            type: "POST",
                            url: "loadmenu.php",
                            success: function(data) {
                                $('#menu').html(data);
                            },
                            error: function() {

                            }
                        });
                    });
                    jQuery('.addchar').live('hover', function(event) {
                        $('.addchar:visible').each(function(index) {
                            $(this).hover(function() {
                                $("#result").html("Index is: " + index);
                            });
                        });
                    });
                });
            });
        &lt;/script&gt;
    &lt;/head&gt;

    &lt;body&gt;
        &lt;div id="content"&gt;
            &lt;form method="post"&gt;
                &lt;a href="#" class="loadm"&gt;Load Menu&lt;/a&gt;
            &lt;/form&gt;
            &lt;div id="menu" style="width:100"&gt;
                none
            &lt;/div&gt;
            &lt;div id="result"&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/body&gt;

&lt;/html&gt;
</code></pre>

<p><strong>Menu file</strong></p>

<pre><code>&lt;?php
echo "&lt;ul&gt;&lt;li class='addchar'&gt;one &lt;/li&gt;
          &lt;li class='addchar'&gt;two &lt;/li&gt;
          &lt;li class='addchar' style='display:none'&gt; three&lt;/li&gt;
          &lt;li class='addchar'&gt;four &lt;/li&gt;
          &lt;li class='addchar' style='display:none'&gt; five&lt;/li&gt;
          &lt;li class='addchar'&gt;six &lt;/li&gt;
          &lt;li class='addchar' style='display:none'&gt; seven&lt;/li&gt;
          &lt;li class='addchar'&gt; eight&lt;/li&gt;
          &lt;li class='addchar' style='display:none'&gt; nine&lt;/li&gt;
                &lt;/ul&gt;";
</code></pre>

<p>?></p>
