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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:33:06+00:00 2026-05-23T03:33:06+00:00

I need to have elements that are dragged from left-hand side area to be

  • 0

I need to have elements that are dragged from left-hand side area to be always on top. And they are when I first drag them from left area, however if I drop them into Box 2 and then decide to drag to Box 1, the item I drag appears below Box 1.

Confused? Here’s DEMO of what I’m talking about.

Yes, I have added zIndex — did not help.

  • 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-23T03:33:07+00:00Added an answer on May 23, 2026 at 3:33 am

    Looks like you are doing some editing. 🙂

    The solution is set the two boxes to the same z-index, and then lower the z-index of the sibling (the box the card is NOT over) using the “start” event. The “stop” event should set them equal again. Of course the draggable itself needs a higher z-index.

    You can also try the stack option.

    EDIT: Working example. Note that its actually the draggable drop event that needs to set the z-indexs equal again.

    You’ll need to make these changes (omit asterisks in your code, of course):

    In dragdrop-client.js

    // make the new card draggable
        newCard.draggable({
            zIndex: 2500,
            handle: ".card",
            stack: ".card",
            revert: "invalid",
            start: function() {
                $(this).effect("highlight", {}, 1000);
                $(this).css( "cursor","move" );
                    **var $par = $(this).parents('.stack');
                    if ($par.length == 1) {
                        console.log('in stack');
                        $par.siblings().css('z-index', '400');
                    }**
            },
            stop: function() {
                $(this).css("cursor","default");
                    $(".stack").css('z-index', '500');
            }
        });
    
    // make the new stack droppable
        newStack.droppable({
            tolerance: "intersect",
            accept: ".card",
            greedy: true,
            drop: function(event, ui) {
                **$(".stack").css('z-index', '500');**
                card = ui.draggable;
                putCardIntoStack(card,stackId);
            }
        }); 
    

    In dragdrop-client.css

    .stack {
        width: 300px;
        border: 1px dashed #ccc;
        background-color: #f5f5f5;
        margin: 10px;
        float:left;
        **z-index:500;**
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 2 elements that both need to be dragged. The simplified markup is
I have a collection of elements that I need to operate over, calling member
I have a list of xml elements that i need to search for specific
I have 2 arrays of 16 elements (chars) that I need to compare and
I have a GridView that I need to dynamically add TemplateField elements to. My
I have a list of html elements that have some text. I need to
I need a way for jQuery to return all elements that have the css
For each agency node I need to find the stmt elements that have the
first some code: I have many elements like that: <section class=item> <div class=caption> </div>
I have to list several elements that are coming from a database source A

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.