$(function(){
$('#tabsSlide #nav li a').click(function(){
var currentNum = $(this).attr('id').slice(-1);
$('#tabsSlide #nav li a').removeClass('current');
$(this).addClass('current');
$('#tabsSlide #content .tab-slide').slideUp(300);
$('#tabsSlide #content #slide-'+currentNum+'.tab-slide').slideDown(300)
$('#contents-of-tab').load(url); // will replace the matched element with the data loaded from url, asynchronously
});
});
Does not work on updating
<div class="slide"> <div id="tabsSlide"> <ul id="nav"> <li><a class="current" id="tab-1" href="#">tab1</a></li> <li><a id="tab-2" href="#">tab2</a></li> </ul> <div id="content"> <div id="slide-1" class="tab-slide" style="display: block"> <ul class="tab-list"> <?php require_once('notes_A.php');?> </ul> </div> <div id="slide-2" class="tab-slide"> <?php require_once('tickets.new_A.php'); ?> </div> </div> </div>