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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:14:23+00:00 2026-05-27T20:14:23+00:00

I’ve writen jQuery code that allows a user to create 2 boxes on screen,

  • 0

I’ve writen jQuery code that allows a user to create 2 boxes on screen, and then drag and drop one into the other. From an HTML perspective it would look like this…

<div id="1">
    <div id="2">
    </div>
</div>

If I then create another box and drag it over box 2 and drop it, it’s always dropped into box 1 (i.e. box 2’s parent). What I want is this…

<div id="1">
    <div id="2">
        <div id="3">
        </div>
    </div>
</div>

…but what I get is this…

<div id="1">
    <div id="2">
    </div>
    <div id="3">
    </div>
</div>

You [USED TO BE ABLE TO] can see this happening here…
http://acarna.com/editor.php <- I’ve fixed the problem…see my answer below

Click the “H” button top left to create a box. Grab the grey square in the upper right corner of the box to drag it further down into the page. Move your mouse over the edge or corner of the box and resize it.

Then click “H” again to create box 2. Drag and drop box 2 into box 1. This works properly. If you use Firefox you can see box as it’s added to box 1 on mouseover.

The problem I’m having is when creating box 3, moving it over box 2 and attempting to drop it inside. It’s detecting only box 1 and dropping it in that.

Is there some trick I’m missing to have jQuery detect box 2 when box 3 is dragged over it, and have it added there instead?

  • 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-27T20:14:24+00:00Added an answer on May 27, 2026 at 8:14 pm

    I just had a moment of clarity after struggling with jQuery UI’s (ahem) sparse documentation.

    The droppable option ‘greedy’ determines where an object will land when it’s dropped on a tree of droppable objects.

    When set to false (the default) the dropped object will land on the lowest droppable object in the tree. When set to true the dropped object will land on the first (i.e. highest) droppable object in the tree.

    This can be demonstrated using the following mark up by way of example. Imagine the following divs are all droppable objects…

    <div id="bottom_container">
        <div id="level_2_container">
            <div id="level_3_container">
            </div>
        </div>
    </div>
    

    A draggable object (given id=”all_new_container” below) is dropped on div#level_3_container. Here’s the markup that results if greedy is false (i.e. the default)…

    <div id="bottom_container">
        <div id="level_2_container">
            <div id="level_3_container">
            </div>
        </div>
        <div id="all_new_container">
        </div>
    </div>
    

    And here’s the markup that results if greedy is set to true…

    <div id="bottom_container">
        <div id="level_2_container">
            <div id="level_3_container">
                <div id="all_new_container">
                </div>
            </div>
        </div>
    </div>
    

    If you have Firebug you watch the above happening as you drop objects into other objects here…
    http://acarna.com/editor.php

    Please excuse the positioning bug that has new dropped elements land in the wrong place beyond level 2. I won’t be fixing that in the above example, and it’s not necessary to do so for the above demonstration.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace

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.