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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:11:49+00:00 2026-06-15T13:11:49+00:00

I have a DOM structure as follows: <div class=hotspot> <div class=hotspot_inner> <div class=hotspot_info> <div

  • 0

I have a DOM structure as follows:

<div class="hotspot">
    <div class="hotspot_inner">
        <div class="hotspot_info">
            <div class="inner_box">
                <h2><%= hotspot.info.title %></h2>
                <p><%= hotspot.info.description.html_safe %></p>
            </div>
        </div>
    </div>
</div>

I also have some CoffeeScript that attaches a click event listener to anything with the class ‘.hotspot’ that makes everything inside the hotspot visible (‘.hotspot_inner’ and down) on click.

Clicking anything with the ‘.hotspot’ class again makes everything inside invisible once more.

The problem is, clicking anything inside the hotspot also triggers the close event attached to its parent.

I’ve tried stopPropagation(), but to no avail. I’ve heard .live has issues like this, but because hotspots are added dynamically, I need to use it.

Any ideas?

  • 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-06-15T13:11:50+00:00Added an answer on June 15, 2026 at 1:11 pm

    The call to stopPropagation() won’t work because the event has already propagated; that’s how the “live” mechanism works.

    What you can do instead is to set a flag somewhere, perhaps on the event object itself. The parent handlers can check for that and know that they’re not supposed to do anything.

    Alternatively, you could check the event target, which jQuery normalizes as the “target” property of the event object. If the parent handlers see that they’re not the target, they can skip the event. This can get tricky sometimes depending on the nature of your interaction patterns and the structure of the DOM.

    You may be interested to learn that .live() has been deprecated for a couple of years now. With current versions of the library you should use .on(), which combines the abilities of .bind() and .delegate().

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

Sidebar

Related Questions

I have the following DOM structure of interest: <div id=portfolioItems> <div class=portfolioItemsLine> <div class=portfolioItem
I have such dom structure: <div class=wrapper> <div class=style1> ... another divs ... </div>
I have the following DOM structure: <div class=city> <div class=a>Delete</div> <div class=b>Selected</div> <div class=c>Delete</div>
I have this structure in my dom: <label>London<input type=checkbox name=London></label><br> <div class=innerpost> <label>N1 2AB<input
I have the following DOM structure: /*:DOC += <div id='testDiv' class='testDivClass'><div id='innerTestDiv'></div></div><span id='testSpan' class='testSpanClass'><span
I have a DOM structure below: <div class='box'> <section id=profile> <h1>testuser</h1> <div id=following> <a
I have a DOM structure that looks like this: <div id=comment-1234 class=comment>...</div> <div id=comment-2391
I have the following dom structure: <div class=ui-tabs> <ul> <li class=ui-state-default ui-tabs-selected ui-state-active> <a
I have a DOM structure that looks like this: <div class=chapter> <section></section> <section></section> </div>
I have the following DOM structure: <div id=cont> <ul> <li> <span class=c1><span class=c2>...</span><span class=c3>...</span></span>

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.