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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:30:33+00:00 2026-05-26T07:30:33+00:00

How do I define the containment area for a draggable to have it draggable

  • 0

How do I define the containment area for a draggable to have it draggable outside of its parent element? I have two droppable containers that have draggable divs in them. I want to drag the contained divs between the containers. But the divs drop under the border of the parent container instead of going across. I can only get the divs to go from one container to another if I set a very high z index, which causes the divs to not really be place in the container. This messes up the page display.

Here is the jsfiddle for this http://jsfiddle.net/gkvgn/8/. The relevant code in that jsfiddle is that function where the container divs are made draggable and droppable and where the contained div elements are made draggable with containment of ‘document’.

$(function() {
    $( "#editdiv" ).resizable();
    $( "#editdiv" ).draggable();
    $( "#editdiv" ).draggable("option", "handle", '#heading');
    $( "#editdiv2" ).resizable();
    $( "#editdiv2" ).draggable();
    $( "#editdiv2" ).draggable("option", "handle", '#heading');
    $( ".comurl" ).draggable();
    $( ".comurl" ).draggable("option", "handle", '#dhandle');
    $( "div.droppable" ).droppable({
        drop: function( event, ui ) {
            var $item = ui.draggable;
            $item.fadeOut(function() {

            $item.css( {"left":"", "top":"", "bottom":"", "right":"" }).fadeIn();
        }); 
    $item.appendTo( this );
        }
    });

    $( ".comurl" ).draggable({ containment: 'document' });

});

If I change the containment to ‘parent’ or ‘window’ the draggable divs in the container seem to be more constrained than if I select ‘document’.

Since I thought that z-index was an issue, I set the z-index for the ui-draggable-dragging class in the css.

.ui-draggable-dragging {
   z-index: 999999;
   background-color: red;
}

What must I fix to be able to drag an element div, e.g. Facebook.com from the first container to the second? 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-26T07:30:34+00:00Added an answer on May 26, 2026 at 7:30 am

    Had to remove overflow: hidden;

    .link_drop_box{
           height:80%;
           /* overflow:hidden; */
    }
    .comdiv { 
           position:absolute; 
           padding: 0; 
           border: 1px solid DarkKhaki;
           border-radius: 3px 3px 0px 0px;
           box-shadow: inset 0px 0px 10px DarkKhaki;
           /* overflow-y: hidden;
           overflow-x: hidden; */
        }
    

    http://jsfiddle.net/gkvgn/10/ .

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

Sidebar

Related Questions

How do I make elements draggable between two divs? This seems to be something
#define BINARY_TREE_PARENT_CORRECT(son, parent) ((son) ? (son->parent == parent) : 1) It turns out that
#define q(k)main(){return!puts(#k\nq(#k));} q(#define q(k)main(){return!puts(#k\nq(#k));}) This code can print itself on the screen,however,I have a
Define z<- as.character(c(1_xx xx xxx_xxxx_12_sep.xls,2_xx xx xxx_xxxx_15_aug.xls)) such that > z [1] 1_xx xx
Define a list dats with two dataframes, df1 and df2 dats <- list( df1
Define a list: nat2::[(Integer, Integer)] that contains all pairs of nonnegative integers ordered by
If I have several levels of object containment (one object defines and instantiates another
Reading several guidelines for jQuery performance I discovered this functionality: Instead of doing: $('#legendGallery).draggable({containment:'#container'});
(define a 42) (set! 'a 10) (define a 42) (define (symbol) 'a) (set! (symbol)
(define (lcs lst1 lst2) (define (except-last-pair list) (if (pair? (cdr list)) (cons (car list)

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.