as mentioned above I tried to make Ajax Tabs with the provided jQuery .ajax() function.
That works all very well, my problem is only that the value in the href attribute from the anchor is in the url and i dont know how to call my ajax function with the #tabname in the url.
(my intention is, that if somebody stores the link of the site, he comes back to right that tab and not to the first tab ).
And I'm sorry no I don't want to use jQuery-UI because if i would use it, it would be only for that one problem and I think thats not worth it.
For understanding:
my tab(or anchor) is something like: <a id="main" href='#main'>Mainpage</a>
my jquery looks like following:
$('#main').click(function(){
loadtab("main.php");
});
function loadTab(pageUrl)
{
//load the content into #tabcontent
$.ajax(
{
url: pageUrl,
cache: false,
success: function(message)
{
$('#tabcontent').empty().append(message).hide().fadeIn('slow');
}
});
EDIT:
if somebody likes the loadTab method, here is a link from were i have taken it from (not mine) http://jetlogs.org/2008/03/17/jquery-ajax-tabs/
EDIT 2:
ok, i solved it like this:
//click the first tab, so that there will be shown anything
//tabs is an array of my link ids
$('#'+tabs[0]).click();
//if there is a given hash, click the matching
if(window.location.hash+"" != ""){
var hash = window.location.hash.substr(1)+'';
if(jQuery.inArray(hash, tabs)){
$('#'+hash).click();
}
}