0

Hello all i have made a tab menu in my sidebar (follow a tutorial), but i have now use codeigniter to echo out some result from the database..

but the tab menu hide my content, but i can see it in the source

This is what i can see in the source

<div style="border-bottom:1px solid #e0e0e0; width:200px; height:100px;" class="sidebarForumWrapper">

    headline text here  

    <div style="border:1px solid #e0e0e0; padding:5px;" class="sidebarForumImg">
        <img width="20" height="20" src="">
    </div>

    <!-- sidebarForumImg -->

    text text text
</div>

<!-- sidebarForumWrapper --> 

and the tab function

<script style="text/javascript">    
    $(function() {
        // setting the tabs in the sidebar hide and show, setting the current tab
            $('div.tabbed div').hide();
            $('div.t1').show();
            $('div.tabbed ul.tabs li.t1 a').addClass('tab-current');

        // SIDEBAR TABS
        $('div.tabbed ul li a').click(function(){
            var thisClass = this.className.slice(0,2);
            $('div.tabbed div').hide();
            $('div.' + thisClass).show();
            $('div.tabbed ul.tabs li a').removeClass('tab-current');
            $(this).addClass('tab-current');
            });
        });
     </script>

if you want you can see my site live here http://www.rapcom.dk

4

2 回答 2

0
$('div.tabbed div').hide();

删除这行代码,然后重试

于 2011-02-05T15:24:51.980 回答
0

您的问题出在这一行:

$('div.tabbed div').hide();

这将display: none所有 div 下的tabbed,而不是使用:

$('div.tabbed > div').hide();

但我建议您重新考虑您的选项卡方法并使用jQuery UI 选项卡或至少使用相同的方法,其中<a>标签将指向相应内容容器的id 。DIV

于 2011-02-05T16:32:44.043 回答