Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6957641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:01:52+00:00 2026-05-27T15:01:52+00:00

i got multiple tabs table, and there are tabs one in another, thus i

  • 0

i got multiple tabs table, and there are tabs one in another, thus i have a mistake in javascript when tab 1 is open: $('.tabcont2:visible')[0].id is undefined, and when tab 2 is open: $('.tabcont0:visible')[0].id id undefined, anyway, hope u’ll understand everything from code:

<script type="text/javascript" src="/JS/tabcontent.js"></script>
<script type="text/javascript">
    function initMenu0() {
        $('#menu0 ul').hide();
        $('#menu0 li a').click(function() {
            var checkElement = $(this).next();
            if ((checkElement.is('ul')) && (checkElement.is(':visible'))) {
                return false;
            }
            if ((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
                $('#menu0 ul:visible').slideUp('normal').siblings('a').removeClass('open_menu0');
                checkElement.slideDown('normal').siblings('a').addClass('open_menu0');
                return false;
            }
        });
        $("ul.reset a").click(function() {
            $(this).closest("ul").siblings("a").addClass("open_menu0");
        });
    }
    function showCurrentTab0() {
        var curId = $('.tabcont0:visible')[0].id,
            $curLink = $('a[rel="' + curId + '"]');

        $curLink.closest('ul').parent('li').children('a').click();
    }

    function initMenu2() {
        $('#menu2 ul').hide();
        $('#menu2 li a').click(function() {
            var checkElement = $(this).next();
            if ((checkElement.is('ul')) && (checkElement.is(':visible'))) {
                return false;
            }
            if ((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
                $('#menu2 ul:visible').slideUp('normal').siblings('a').removeClass('open_menu2');
                checkElement.slideDown('normal').siblings('a').addClass('open_menu2');
                return false;
            }
        });

        $("ul.reset a").click(function() {
            $(this).closest("ul").siblings("a").addClass("open_menu2");
        });
    }
    function showCurrentTab2() {
        var curId = $('.tabcont2:visible')[0].id,
            $curLink = $('a[rel="' + curId + '"]');

        $curLink.closest('ul').parent('li').children('a').click();
    }

    $(document).ready(function() {
        initMenu0();
        showCurrentTab0();
        initMenu2();
        showCurrentTab2();
    });
</script>

and the html code:

<div class="block tabbox2">
 <div class="tabbox2">
    <ul id="gstabs2" class="reset">
        <li><a rel="g1" class="selected" href="#">Micae</a></li>
        <li><a rel="g2" href="#">Dahua</a></li>
    </ul>

    <div class="tabgreybox2">
        <div id="g1" class="tabcontent2">
            <div style="position:relative;min-height:430px;">
                <div style="position:absolute;left:-250px;top:-30px;">
                    <div id="gstabs1">
                        <ul id="menu0">
                            <li>
                                <a href="#">Mobil DVR</a>
                                <ul class="reset">
                                    <li><a rel="gs1" class="selected" href="#">MDVR</a></li>
                                    <li><a rel="gs2" class="selected" href="#">Client</a></li>
                                </ul>
                            </li>
                        </ul>
                    </div>
                </div>
                <div style="position:absolute;left:0;">
                    <div class="block tabbox0">
                        <div class="tabbox0">
                            <div class="tabgreybox0">
                                <div id="gs1" class="tabcont0">
                                MDVR
                                </div>
                                <div id="gs2" class="tabcont0">
                                Client
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <script type="text/javascript">
                var countries=new ddtabcontent("gstabs1")
                countries.setpersist(true)
                countries.setselectedClassTarget("link")
                countries.init()
            </script>
        </div>
        <div id="g2" class="tabcontent2">
            <div style="position:relative;min-height:430px;">
                <div style="position:absolute;left:-250px;top:-30px;">
                    <div id="gstabs3">
                        <ul id="menu2">
                            <li>
                                <a href="#">Dökümanlar</a>
                                <ul class="reset">
                                    <li><a rel="s1" class="selected" href="#">PSS</a></li>
                                    <li><a rel="s2" href="#">DVR</a></li>
                                </ul>
                            </li>
                        </ul>
                    </div>
                </div>  
                <div style="position:absolute;left:0;top:0;">
                    <div class="block tabbox0">
                        <div class="tabbox0">
                            <div class="tabgreybox0">
                                <div id="s1" class="tabcont2">
                                    PSS
                                </div>
                                <div id="s2" class="tabcont2">
                                    DVR
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <script type="text/javascript">
                var countries=new ddtabcontent("gstabs3")
                countries.setpersist(true)
                countries.setselectedClassTarget("link")
                countries.init()
            </script>
        </div>
    </div>

    <script type="text/javascript">
        var countries=new ddtabcontent("gstabs2")
        countries.setpersist(true)
        countries.setselectedClassTarget("link")
        countries.init()
    </script> 
 </div>
</div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:01:53+00:00Added an answer on May 27, 2026 at 3:01 pm

    swap

    $('.tabcont0:visible')[0].id
    

    with

    $('.tabcont0:visible:first').attr('id');
    

    jQuery will sort out the rest.


    Adding [0] will reference the actual DOM element, not jQuerys element. If that raw element doesn’t exist any further functions will cause an error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have multiple tabs and within them I have got an activity group for
I have a form with multiple tabs. Each tab has its own <form> ,
I've got multiple independent boxes on my page all using {float:left}. There's nothing else
I have got multiple children which I display in a grid. 4 children fits
I've got multiple input fields where they have the same class names. I need
I've got a setup with multiple text area's on multiple jQuery tabs, all making
I've got multiple form_alter s in my D7 website. One contrib and one custom.
I've got multiple git repos under a directory, and I was wondering whether there
I know you've got multiple topics touching on this. But, I havent found one
I have a form where I've got multiple text inputs for various timefields, each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.