2010-03-31 215 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是第一個元素