0

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

HTML:

<div id="featured">
         <ul>
              <li class="active">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 :)

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

3 Comments

This is the problem, just add an empty function as the 2nd parameter (or use the event directly instead of hover).
I hadn't though of that. I'm using the version built into drupal 6 which appears (in my case) to be 1.2.6.
Yeah, then you've to pass a second function to hover. Or you can switch to mouseover.
0

Jquery hover has 2 functions:

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.