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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:10:33+00:00 2026-05-27T21:10:33+00:00

I have an application that works like a virtual desktop, with a toolbar with

  • 0

I have an application that works like a virtual desktop, with a toolbar with icons that’s clickable. When an icon is clicked a window like box is opened (created dynamically) with different content regarding which icon was clicked.

With a function called moveOnTop() (see below) that gets called when a window gets created a click event is bound to that window. If several windows is opened and the user clicks on a window that’s ordered behind another window the clicked window is moved to the top.

Now to the problem…

When clicking one of the icons, a box is opened showing a bunch of thumbnail images, and when clicking on one of the thumbnails a new window is opened with that particular image. That window with the image should be moved to the top, but that doesn’t happen due to that the click event on the thumbnail box that was clicked gets fired after the window with the image gets created, which leads to that window being moved to the top.

I didn’t know how to explain the problem in other words and I hope you can understand what I mean.

Windows.prototype.buildWindow = function(){

    // a function that created the boxes

    Windows.prototype.moveOnTop();
}

Windows.openedImg = function(){

    // a function that creates the box with the clicked image

    var thisWindow = $(this);
Windows.prototype.getZindex(thisWindow);
}

Windows.prototype.moveOnTop = function(){

var boxes = $('.window');

    boxes.click(function() {
    
        var thisWindow = $(this);
        Windows.prototype.getZindex(thisWindow);
    });
}

Windows.prototype.getZindex = function(thisWindow){

var boxes = $('.window');
var maxZindex = 0;

    boxes.each(function() {

        var zIndex = parseInt($(this).css('z-index'), 10);
        maxZindex = Math.max(maxZindex, zIndex);
    });

thisWindow.css("z-index", maxZindex + 1);
}
  • 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-27T21:10:34+00:00Added an answer on May 27, 2026 at 9:10 pm

    Html:

    <img onclick="openWindow(true)" ... />
    

    Javascript:

    function openWindow(doNotGoToTop) {
        ... //open window
        if (!doNotGoToTop) {
            ... //go to top
        }
    }
    
    • 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 (icons in a horizontal
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
We have an application that works with MS Office and uses Microsoft.mshtml.dll. We use
I have an application that works pretty well in Ubuntu, Windows and the Xandros
I have an application that works great on my development workstation but fails when
I have an application that works some what similar to how iPhone's Contact application
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

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.