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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:17:47+00:00 2026-05-13T08:17:47+00:00

Example code so I can start explaining this problem: <div style=z-index:5>5</div> <div style=z-index:2>2</div> <div

  • 0

Example code so I can start explaining this problem:

<div style="z-index:5">5</div>
<div style="z-index:2">2</div>
<div style="z-index:1">1</div>
<div style="z-index:4">4</div>
<div style="z-index:3">3</div>

(z-index values do not matter, and their order, even less. Just example code)

Problem: I want to select (either using CSS or JS with jQuery) the DIV with highest z-index value. In the case above, I want to select the first one, because it’s z-index 5 is higher than all the others’ z-indexes.

Is there a way to do this?
Extra information: I’m writing a Simple Window Manager with jQuery + jQuery UI, and the z-indexes are assigned by the stack option in .draggable.
I can’t seem to find a way to make jQuery to assign the last dragged element a class either, so I’m going by the highest z-index way. Any help please? 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-05-13T08:17:48+00:00Added an answer on May 13, 2026 at 8:17 am

    I’m sure you could use the stop event to gain access to the recently dragged item, i.e.:

    $('.selector').draggable({
       stop: function(event, ui) {
          $(event.target).addClass('justDragged');
       }
    });
    

    If you wish to see all functions/variables bound to event, you could use the following:

    var str = '';
    for (i in event) {
        str += i + ', ';
    }
    alert(str);
    

    This should give you a good indication of what’s available to you in any number of jQuery callback params.

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

Sidebar

Related Questions

Can someone give me some example code that creates a surface with a transparent
I've heard powershell 2.0 CTP has modules, but I can't find much example code
can anyone please suggest a good code example of vb.net/c# code to put the
How can you depend on test code from another module in Maven? Example, I
How can I convert a character to its ASCII code using JavaScript? For example:
Is there good example code or a test project for explaining the Model–view–presenter (MVP)
Many C++ books contain example code like this... std::cout << Test line << std::endl;
There is this example code, but then it starts talking about millisecond / nanosecond
Can source code examples be kept in a SQL database while retaining all formatting
here is my example code: Public Class Parent Private _TestProperty As String Private WithEvents

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.