0

Here is how I have done it, when at page containing all the tabs, I can go to tab 1, tab 2 etc. But when Im going to link Testpage, I would like to go to tab1 and tab2 etc. again without going to the tabpage. I I want to have one meny that I can include in all pages.

<li class="active" id="information_btn"><a href="#" title="" class="not_link">tab1</a></li>
<li><a href="testpage.php" title="">Testpage</a></li>
<li id="dns_btn"><a href="#" class="not_link" title="">Tab2</a></li>


$(document).ready(function(){   
    $('li#information_btn').click(function(){
        $('ul.submenu-accounts > li').removeClass('active');
            $('div.tab_selected').removeClass('tab_selected');
        $('div.tab_content').hide();
        $('div#information_tab_content').show();
        $(this).addClass('active');
    });
    $('li#dns_btn').click(function(){
        $('ul.submenu-accounts > li').removeClass('active');
        $('div.tab_selected').removeClass('tab_selected');
        $('div.tab_content').hide();
        $('div#nameservers_tab_content').show();
        $(this).addClass('active');
    });
    $('a.not_link').click(function(event){event.preventDefault();});
4

1 回答 1

0

添加条件语句来检查href属性。然后使用.load()if 它是要显示到 content 的 url div

于 2012-12-15T16:10:39.913 回答