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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:41:57+00:00 2026-05-12T19:41:57+00:00

I have a setup like this: <div id=container> <div id=close>Close</div> </div> Then in my

  • 0

I have a setup like this:

    <div id="container">
       <div id="close">Close</div>
    </div>

Then in my jquery I have this:

$("#container").live("click",function(){
   changeTabs();
});

$("#close").live("click", function(){
   closeTabs();
});

The problem with that is that when you click the close div it fires both events. I am guessing it is because the second div overlays the first one. So how can I cancel or stop the first event from firing?

  • 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-12T19:41:57+00:00Added an answer on May 12, 2026 at 7:41 pm

    Check out event.stopPropagation()

    From the jQuery docs:

    Stops the bubbling of an event to
    parent elements, preventing any parent
    handlers from being notified of the
    event.

    In your case, this might look like

    $("#close").live("click", function(evt){
       evt.stopPropagation();
       closeTabs();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a setup much like this: $('.container a').click(function(event) { event.preventDefault(); $('#contents').remove(); $(this).parent().append(<div id=\contents\></div>);
I have a setup, something confusing like this: <ListView> <ItemTemplate> <div id=Content> <asp: TextBox
OK I have backgrounds set up like this: HTML <div id=container> <div id=content> CONTENT
I have a jquery template setup like this: <script id='tmpl-video_list' type='text/x-jquery-tmpl'> <li> <a href='${url}'><br/>
ok so basically I have a setup like this: <div id=tabs> <div id=tab_one> Something
I have a basic overlay setup using css/html/jquery and it goes like this: <a
Ok I have a page setup that looks like this: <div class=parent>Content here</div> I
I want to have a setup like this: <div id=block> <div class=btn>2</div> <div class=btn>1235e</div>
I have some HTML setup like this: <div> <label for=amount><a id=amount-help-icon class=help icon-link href=#><span
I have a setup like this: http://jsfiddle.net/zzjSC/3/ and I am wondering why the surrounding

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.