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

有帮助吗?

解决方案

Your problem is with this line:

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

This would display: none ALL the divs under tabbed, instead use:

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

But I recommend you reconsider your Tabs approach and use the jQuery UI Tabs or at least using the same approach where the <a> tags will point to the id of the corresponding DIV content container.

其他提示

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

remove this line of code and try again

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top