Reputation: 1025
I have two functions that loads on document ready. They work fine when they are ran individually. But when both functions are called on the same document ready js. One of them(second one) doesn't work. Please help. The files are set up at: http://jsfiddle.net/rexonms/FXPhu/15/
The basic code is following which is called on document ready. And it calls jQuery 1.2.6 - it's a closed CMS and I cannot change the version of jQuery:
// Sidebar Accordion Nav
$("#linkListSub3 li li").hide();
$("#linkListSub3 li").hover(function() {
if ($("li", this).is(":hidden")) {
$("#linkListSub3 li li").next().slideUp();
$("li", this).next().slideDown();
}
return false;
});
//Hide And show Toggle Bar animation
$(".toggleContainer").hide(); //Hide (Collapse) the toggle containers on load
//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
$("a.trigger").click(function() {
$(this).toggleClass("active").next().slideToggle("slow");
return false; //Prevent the browser jump to the link anchor
});
Upvotes: 3
Views: 126
Reputation: 227230
You are only passing one function to .hover()
. That syntax wasn't added until jQuery 1.4. You need to either pass 2 functions to hover
, or change hover
to mouseover
or mouseout
(depending on what you want to do).
Upvotes: 0
Reputation: 78650
The call to hover
is blowing up with only one parameter passed. Add an empty function as the 2nd parameter and it works.
Upvotes: 8