0

有人可以告诉我如何使用 Jquery Vallenato 使第一个手风琴在页面加载时不打开吗?

$(document).ready(function()
{
//Add Inactive Class To All Accordion Headers
$('.accordion-header').toggleClass('inactive-header');

//Set The Accordion Content Width
var contentwidth = $('.accordion-header').width();
$('.accordion-content').css({'width' : contentwidth });

//Open The First Accordion Section When Page Loads
$('.accordion-header').first().toggleClass('active-header').toggleClass('inactive-header');
$('.accordion-content').first().slideDown().toggleClass('open-content');

// The Accordion Effect
$('.accordion-header').click(function () {
    if($(this).is('.inactive-header')) {
        $('.active-header').toggleClass('active-header').toggleClass('inactive-header').next().slideToggle().toggleClass('open-content');
        $(this).toggleClass('active-header').toggleClass('inactive-header');
        $(this).next().slideToggle().toggleClass('open-content');
    }

    else {
        $(this).toggleClass('active-header').toggleClass('inactive-header');
        $(this).next().slideToggle().toggleClass('open-content');
    }
});

return false;
});

http://www.switchroyale.com/vallenato/

4

1 回答 1

1

注释掉这个部分,像这样:

//Open The First Accordion Section When Page Loads
//$('.accordion-header').first().toggleClass('active-header').toggleClass('inactive-header');
//$('.accordion-content').first().slideDown().toggleClass('open-content');
于 2012-08-10T16:42:57.590 回答