J'ai utilisé des panneaux à onglets dans quelques projets récents, et la solution que je l'ai utilisé est le suivant:
HTML
<ul class="tabs">
<li><a href="#en_en">English</a></li>
<li><a href="#fr_fr">Français</a></li>
</ul>
<div class="panel" id="en_en"><!-- Content --></div>
<div class="panel" id="fr_fr"><!-- Content --></div>
jQuery
// the currently selected tab, or a default tab (don't forget to prepend the #)
var tab = location.hash || '#en_en';
// register a click handler on all the tabs
$('ul.tabs a').click(function(event){
event.preventDefault(); // prevents the browser from scrolling to the anchor
// hide all panels, then use the link's href attribute to find
// the matching panel, and make it visible
// you can, of course, use whatever animation you like
$('div.panel').hide().filter( $(this).attr('href') ).show();
).filter('[href*='+tab+']').click();
// above: in case of refreshing/bookmarking: find the tab link that contains
// the current location.hash, and fire its click handler
Cela fonctionne bien car le code côté serveur n'a pas besoin de savoir quel onglet est sélectionné, mais il prend également en charge l'actualisation ou la mise en favori d'un onglet spécifique sans que l'utilisateur ne doive à nouveau sélectionner l'onglet.
Pourquoi ne pas simplement changer la barre latérale en fonction de l'onglet lorsque l'onglet est sélectionné? – cgp