我的手风琴出了问题

trouble with accordion I am making

本文关键字:问题 手风琴 我的      更新时间:2023-09-26

我正在为学校制作手风琴,我觉得它应该能用。我知道,在if-else声明之前,我什么都做对了。任何建议都感谢

$(document).ready(function () {
    //
    // Set up a click event handler for clicked <li>
    //
    $('#accordion li').click(function() {
        // find first ul that is a child of this (the clicked <li>)
        var $nextUL = $(this).children('ul:first-child');
        // Select all siblings of the clicked <li> and then 
        // select any direct children <ul>'s 
        // that are visible - this is so we can close any visible
        // <ul> before opening the <ul> for the clicked <li>
        var $visibleSiblings = $(this).siblings().children('ul:visible');
        // If any other <ul>s are visible, slide the visible <ul>
        // up and then, after the slide up is complete, slide down 
        // the clicked <li>'s <ul> into view
        if ($visibleSiblings.length > 0) {
             $visibleSiblings.slideUp('normal', function() {
             $nextUL.fadeIn('normal');
             });
        } else {
            // either no <ul>s were open (open the clicked item)
            // or the user clicked on the currently open one so close it
            $nextUL.slideToggle('normal');
        }
    });
});

Jquery fadeIn()的持续时间没有"normal"。

 $nextUL.fadeIn('normal');

参考http://www.w3schools.com/jquery/eff_fadein.asp

速度:可选。指定渐变效果的速度。默认值为400毫秒可能值:

  milliseconds
  "slow"
  "fast"