2010-03-31 164 views
1

如何默认情况下,“Firstpane”设置为打开,其他关闭.... 我复制相同的代码从这个sample但我的一切都是开放的view herejQuery的手风琴标签

脚本

<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> 

回答

1

删除这个固定我的问题“initialIndex:空”

0

,或者你可以把initialIndex:0,记得NU mber您将使用,表示默认窗格,0是第一个元素