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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:42:34+00:00 2026-06-11T20:42:34+00:00

i tried using stopPropagation() without luck. I’ve this structure: <div class=logos> </div> I’ve a

  • 0

i tried using stopPropagation() without luck.
I’ve this structure:

<div class="logos">  
</div>

I’ve a click binded to logos, that appends img elements inside it ends up like:

<div class="logos">
  <img width="100" height="80" src="/js/fileupload/uploads/Penguins.jpg">  
  <img width="100" height="80" src="/js/fileupload/uploads/Hydrangeas.jpg">
</div>

I want to bind a click event to those image, so when they’re clicked they can be removed from the “logos” div, i used .live() to track those clicks.
The result is that when i click an image, both the “logos” click event and the img click event are fired.

    $('.logos img').live('click', function(e){
        var answer = confirm ("Delete image?")
        if (answer){
            $(this).remove();
        }
    });
    $('.logos').click(function(e){
            e.stopPropagation();
            $('.qq-upload-button input').trigger('click'); //File uploader that uploads images and creates the img elements.
    });  

Thanks

  • 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-11T20:42:35+00:00Added an answer on June 11, 2026 at 8:42 pm

    You could do something like this. If you are using > jQuery 1.4 you should be using on instead of live. Check the target and if it is an image then remove it. Otherwise leave it be.

    http://jsfiddle.net/AprTx/

    $('.logos').on('click', function(e) {
        e.stopPropagation();
    
        if ($(e.target).is('img')) {
            $(e.target).remove();
        }
        else {
            $(this).append($('<img src="http://placehold.it/300x300" />'));
        }
    });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried using height: 100% but this makes the div only as high as
I tried using juggernaut cocoa: https://github.com/fpotter/juggernaut-cocoa Added this line to my code: JuggernautClient *client
I tried using this How do I test Pony emailing in a Sinatra app,
I tried using this code in this thread: How can I uninstall an application
I tried using Google's feed to JSON converter like this: http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&q=http%3A%2F%2Fnews.google.com%2Fnews%3Foutput%3Drss%26num%3D8 The only problem
I'm using hammer.js and it appears that I event.stopPropagation() doesn't work with tap event.
Tried using this function on a paragraph consisting of 3 strings and abbreviations. #!/usr/bin/env
I tried using Formatter.format, but that seems to leave the mantissa on numbers with
I tried using ActiveResource to parse a web service that was more like a
I tried using xsd.exe to convert an .xsd file into a C# class. It

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.