Jquery Accordion tabs
How do I default the "Firstpane" set to open and the others are closed.... I copied the same code from this sample but on mine everything is open view here
Script
<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();
开发者_JAVA百科});
});
</script>
Removing this fixed my problem "initialIndex: null"
or you can put initialIndex: 0 , remember the number you will use, indicate the default pane, 0 is the first element
精彩评论