Jquery Accordion标签

时间:2010-03-31 18:51:05

标签: javascript jquery wordpress

如何默认“Firstpane”设置为打开而其他设置已关闭.... 我从此sample复制了相同的代码,但是我的所有内容都已打开view here

脚本

<script>
$(function() { 

$("#accordion").tabs("#accordion div.pane", {tabs: 'h2', effect: 'slide', initialIndex: null});
});
</script>

<script>

// add new effect to the tabs
$.tools.tabs.addEffect("slide", function(i, done) {

    // 1. upon hiding, the active pane has a ruby background color
    this.getPanes().slideUp().css({backgroundColor: "#fff"});

    // 2. after a pane is revealed, its background is set to its original color (transparent)
    this.getPanes().eq(i).slideDown(function()  {
        $(this).css({backgroundColor: 'transparent'});

        // the supplied callback must be called after the effect has finished its job
        done.call();
    });
});
</script>

2 个答案:

答案 0 :(得分:1)

删除此修复我的问题“initialIndex:null”

答案 1 :(得分:0)

或者你可以把initialIndex:0,记住你要使用的数字,指出默认窗格,0是第一个元素