Created
September 23, 2009 13:31
-
-
Save petemounce/192005 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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