开发者

jquery .hover() error

In the following code, I am attempting to act upon the li element being hovered over.

HTML:

<div id="featured">
         <ul>
              <li class="activ开发者_StackOverflow社区e">foo</li>
              <li class="">bar</li>
              <li class="">giraffe</li>
         </ul>
    </div>

JavaScript:

  $(document).ready(function () {
        $('#featured ul li').hover(function(){
        //do stuff, or not
        });
    });

But this line of code is causing the following error in FF and I'm clueless as to what is causing it.

g.guid is undefined

This occurs even if the line of JS has nothing occurring inside the function. Any insight would be welcome :)


What version of jQuery are you using? That sounds like an old version. Also prior to v1.4, .hover() takes two functions.


Jquery hover has 2 functions:

$(document).ready(function () {
    $('#featured ul li').hover(
       function(){
        //do stuff on hover over
       },
       function(){
        //do stuff on hover out
       });
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜