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

  • Home
  • SEARCH
  • 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 7038549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:40:57+00:00 2026-05-28T01:40:57+00:00

I have an application that works like a virtual desktop (icons in a horizontal

  • 0

I have an application that works like a virtual desktop (icons in a horizontal bar in the bottom). When you click on an icon, a window opens (dynamically created). If you click on another (or the same) icon another window opens 10px down and 10px to the right from the last one, and is moved on the top.

When a window gets created, the function below runs adding a click event to the window. If the window is clicked it gets moved to the top.

Now to the problem. One of the windows contains thumbnails of images. When clicking on an image a new window gets created with the image in full size. I want the new window with the full size image to be placed on top, which doesn’t happen because the event (in the moveOnTop function) fires after the new window is created on the thumbnail window (because I clicked that window when I clicked on a thumbnail).

I guess one way to solve this would be if it was possible to prevent the event to be fired if a thumbnail is clicked, though I don’t know how. What could otherwise be a good way to solve this? Thanks in advance!

Windows.prototype.moveOnTop = function(){
var container = '#desktop';

    $(container).on('click', '.window', function() {
        var thisWindow = $(this);
        if(thisWindow.next().length > 0){
            thisWindow.appendTo('#desktop');
        }
    });
};
  • 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-28T01:40:58+00:00Added an answer on May 28, 2026 at 1:40 am

    Inside the click event handler for thumbnails you can cancel the the event for other (parent) elements:

    $("img.thumbnail").on("click", function(e) {
        ...
    
        // Finally, prevent the click event from bubbling up to parent elements
        e.stopPropagation();
    });
    

    See: event.stopPropagation()

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

Sidebar

Related Questions

I have an application that works like a virtual desktop (icons in a horizontal
I have an application that works like a virtual desktop, with a toolbar with
I currently have a UINavigationController based application that works just fine. I'd like to
I have an application that is going to work like a p2p-software where all
I have a web application that works in our stage/test environment fine but once
I have an application that perfectly works on iPhone os 2.2.1 but when I
We have a C# application that works fine on windows XP and windows vista
I have an application that is works fine and the JFrame for it is
I have a C++ application that works and compile perfectly. I can execute and
I have a Rails application that works with mongodb. I want to deploy 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.