我有两个函数可以加载文档就绪.它们单独运行时工作正常.但是当两个函数都在同一个文件上调用就绪js.其中一个(第二个)不起作用.请帮忙.文件设置在:http: //jsfiddle.net/rexonms/FXPhu/15/
随后将在文档就绪时调用基本代码.它调用jQuery 1.2.6 - 它是一个封闭的CMS,我无法更改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
});
Run Code Online (Sandbox Code Playgroud)