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 929899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:14:49+00:00 2026-05-15T20:14:49+00:00

I have a tab (called firsttab) with in his content another tab (called childtab).

  • 0

I have a tab (called firsttab) with in his content another tab (called childtab). We bind the tabshow-event to the firsttab.

If we click to one of the tabs in "firsttab" all work fine (Tab 1 – Tab 5).
If we click to one of the "childtab" tabs (Tab 1.1 – Tab 1.3) the tabshow-event who are bind to the "firsttab" is triggerd.

Testcase: http://jsfiddle.net/bM8Wh/

HTML:

<div id="firsttab">
    <ul>
        <li><a href="#firsttab_1">Tab 1</a></li>
        <li><a href="#firsttab_2">Tab 2</a></li>
        <li><a href="#firsttab_3">Tab 3</a></li>
        <li><a href="#firsttab_4">Tab 4</a></li>
        <li><a href="#firsttab_5">Tab 5</a></li>
    </ul>
    
    <div id="firsttab_1">
        <div id="childtab">
            <ul>
                <li><a href="#childtab_1">Tab 1.1</a></li>
                <li><a href="#childtab_2">Tab 1.2</a></li>
                <li><a href="#childtab_3">Tab 1.3</a></li>
            </ul>
            
            <div id="childtab_1">Tab 1.1</div>            
            <div id="childtab_2">Tab 1.2</div>
            <div id="childtab_3">Tab 1.3</div>
        </div>
    </div>
    <div id="firsttab_2">Tab 2</div>
    <div id="firsttab_3">Tab 3</div>
    <div id="firsttab_4">Tab 4</div>
    <div id="firsttab_5">Tab 5</div>
</div>

JavaScript:

$("#firsttab, #childtab").tabs();
$("#firsttab").bind('tabsshow', function(event, ui) { funcX(ui.index); });
  
function funcX(idx){
    alert('triggerd - index: ' + idx);
}

I don’t understand why the tabsshow-event is triggered by the childtab because I bind this event to the firsttab.

The answer of my jQuery-ticked was:

"Events bubble; check the target."

but I don’t understand what it means.

I handle the problem by change my tabsshow-event-handler to:

$("#tabs").bind('tabsshow',
  function(event, ui) {
    if ((/#(.*?)$/im).exec(ui.tab.hash)[1] == this.id)
      funcX(ui.index);
  });

but I will understand where are the problem.

  • 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-15T20:14:51+00:00Added an answer on May 15, 2026 at 8:14 pm

    By default, event’s bubble, meaning that an event in a child element goes up to all parent elements unless you stop it. So for example a click anywhere on the page is a click event on that element, it’s parent, and so on up until document. This behavior also happens with any custom jQuery events like tabsshow, but if you don’t want it you can stop the event from bubbling using event.stopPropagation(), like this:

    $("#childtab").bind('tabsshow', function(event, ui) { 
      event.stopPropagation(); 
    });
    

    This stops the event from firing on #firsttab because it just doesn’t bubble up there anymore. You can try your sample with this fix here.

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

Sidebar

Related Questions

I've got 3 tabs. Each of them have a div called optional , apart
I have a Tab Control with multiple Tab Pages. I want to be able
I have a tab navigator control and I would like to make all of
I have a tab page that should be hidden if a property (BlahType) is
I have 2 tab items. In tab No.1 I have a control which corresponds
I have a tab delimited file where each record has a timestamp field in
Modern browsers have multi-tab interface, but JavaScript function window.showModalDialog() creates a modal dialog that
So I have a form with lots of controls that all have a tab
I have a huge tab separated file which I want to sort on its
I have to parse a tab-delimited text file with Ruby to extract some data

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.