Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@petemounce
Created September 23, 2009 13:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petemounce/192005 to your computer and use it in GitHub Desktop.
Save petemounce/192005 to your computer and use it in GitHub Desktop.
$(function () {
//create tabs
$('.sidebar .content').append('<ul class="ui-tabs-nav"></ul>');
$('.ui-tabs-target fieldset').each(function () {
var TabId = $(this).attr('id');
$('.ui-tabs-nav').prepend('<li><a href="#' + TabId + '">' + $('legend',this).text() + '</a></li>');
});
//show / hide tabs
var TabTarget = $('.ui-tabs-target > fieldset');
TabTarget.hide().filter(':first').show();
$('.ui-tabs-nav a').click(function () {
TabTarget.hide();
$('.ui-tabs-nav a').removeClass('selected');
TabTarget.filter(this.hash).show();
$(this).addClass('selected');
return false;
}).filter(':first').click(0);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment