Comment régler un accordéon par défaut pour le fermer au démarrage. voici la vue échantillon hereDynamic Jquery Accordion
Voici le code:
<script>
$(function() {
$("#accordion").tabs("#accordion div.pane", {tabs: 'h3', effect: 'slide'});
});
</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("slow").css({backgroundColor: "#fff"});
// 2. after a pane is revealed, its background is set to its original color (transparent)
this.getPanes().eq(i).slideDown("slow", function() {
$(this).css({backgroundColor: 'transparent'});
// the supplied callback must be called after the effect has finished its job
done.call();
});
});
</script>
Juste un aparté ici, il y a un accordion d'interface utilisateur jQuery qui est '.accordion()' http://jqueryui.com/demos/accordion/ Peut vouloir clarifier que vous utilisez réellement le widget onglets dans la question :) –
Je n'utilise pas le widget que j'ai re-posté avec le lien de l'échantillon que je suis –