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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:20:10+00:00 2026-05-13T12:20:10+00:00

I have many elements (floating href tags) in a div with a set height/width,

  • 0

I have many elements (floating href tags) in a div with a set height/width, with scroll set to overflow: auto in the CSS.

This is the structure of the divs:

<div id="tagFun_div_main">
<div id="tf_div_tagsReturn">
    <!-- all the draggable elements go in here, the parent div scolls -->
</div>
<div id=" tf_div_tagsDrop">
    <div id="tf_dropBox"></div>
</div></div>

the parent div’s, ‘tf_div_tagsReturn’ and ‘tf_div_tagsDrop’ will ultimately float next to each other.

Here is the jQuery which is run after all of the ‘draggable’ elements have been created with class name ‘tag_cell’, :

$(function() {
    $(".tag_cell").draggable({ 
        revert: 'invalid', 
        scroll: false,
        containment: '#tagFun_div_main'
    });
    $("#tf_dropBox").droppable({
        accept: '.tag_cell',
        hoverClass: 'tf_dropBox_hover',
        activeClass: 'tf_dropBox_active',
        drop: function(event, ui) {
            GLOBAL_ary_tf_tags.push(ui.draggable.html());
            tagFun_reload();
        }
    });
}); 

as I stated above, the draggable elements are draggable within div ‘tf_div_tagsReturn’, but they do not visually drag outside of that parent div. worthy to note, if I am dragging one of the draggable elements, and move the mouse over the droppable div, with id ‘tf_dropBox’, then the hoverclass is fired, I just can’t see the draggable element any more.

This is my first run at using jQuery, so hopefully I am just missing something super obvious. I’ve been reading the documentation and searching forums thus far to no prevail 🙁

UPDATE:

many thanks to Jabes88 for providing the solution which allowed me to achieve the functionality I was looking for. Here is what my jQuery ended up looking like:

$(function() {
    $(".tag_cell").draggable({ 
        revert: 'invalid', 
        scroll: false,
        containment: '#tagFun_div_main',
        helper: 'clone',
        start : function() {
        this.style.display="none";
        },
        stop: function() {
        this.style.display="";
        }
    });
    $(".tf_dropBox").droppable({
        accept: '.tag_cell',
        hoverClass: 'tf_dropBox_hover',
        activeClass: 'tf_dropBox_active',
        drop: function(event, ui) {
            GLOBAL_ary_tf_tags.push(ui.draggable.html());
            tagFun_reload();
        }
    });
}); 
  • 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-13T12:20:10+00:00Added an answer on May 13, 2026 at 12:20 pm

    Are you going to allow more than one instance with your draggable objects? then use the helper and append option:

    $(".tag_cell").draggable({ 
      helper: 'clone',
      appendTo: 'div#myHelperHolder'
    });
    

    Then in your css you can set the zindex of div#myHelperHolder to be 999.
    If not, then try just using the zindex option:

    $(".tag_cell").draggable({ 
      zIndex: 999
    });
    

    I would also consider setting addClasses to stop the plugin from adding all those annoying classes that waste processor speed.

    UPDATE: I HAVE A NEW SOLUTION

    Okay after playing with it for a bit I came up with this: the scroll option doesn’t stop the child from being hidden with overflow. I’ve read some other posts and I cant find a single solution. But I came up with a bit of a work-a-round that gets the job done.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <script type="text/javascript" src="http://www.google.com/jsapi"></script>
        <script type="text/javascript">
        google.load("jquery", "1.4.0");
        google.load("jqueryui", "1.7.2");   
        google.setOnLoadCallback(OnLoad);
        function OnLoad(){
            var dropped = false;
            $(".tag_cell").draggable({ 
                addClasses: false,
                revert: 'invalid',
                containment: '#tagFun_div_main',
                helper: 'clone',
                appendTo: '#tagFun_div_helper',
                start: function(event, ui) {
                    dropped = false;
                    $(this).addClass("hide");
                },
                stop: function(event, ui) {
                    if (dropped==true) {
                        $(this).remove();
                    } else {
                        $(this).removeClass("hide");
                    }
                }
            });
            $("#tf_dropBox").droppable({
                accept: '.tag_cell',
                hoverClass: 'tf_dropBox_hover',
                activeClass: 'tf_dropBox_active',
                drop: function(event, ui) {
                    dropped = true;
                    $.ui.ddmanager.current.cancelHelperRemoval = true;
                    ui.helper.appendTo(this);
                }
            });
        }
        </script>
        <style>
            div#tagFun_div_main { display:block; width:800px; height:400px; margin:auto; padding:10px; background:#F00; }
            div#tf_div_tagsReturn { display:block; width:200px; height:100%; float:left; overflow:auto; background:#000; }
            div#tf_div_tagsDrop { display:block; width:200px; height:100%; float:right; background:#0F0; }
            div#tf_dropBox { display:block; width:100%; height:250px; background:#F0F; }
            span.tag_cell { display:block; width:25px; height:25px; margin:1px; float:left; cursor:pointer; background:#0FF; z-index:99; }
            span.tag_cell.hide { display:none; }
            div#tf_dropBox.tf_dropBox_hover { background:#FFF !important; }
            div#tf_dropBox.tf_dropBox_active { background:#333; }
        </style>
    </head>
    <body>
        <div id="tagFun_div_main">
            <div id="tf_div_tagsReturn">
                <span class="tag_cell"></span>
                <span class="tag_cell"></span>
                <span class="tag_cell"></span>
                <span class="tag_cell"></span>
                <span class="tag_cell"></span>
                <span class="tag_cell"></span>
                <span class="tag_cell"></span>
                <span class="tag_cell"></span>
                <span class="tag_cell"></span>
                <span class="tag_cell"></span>
                <span class="tag_cell"></span>
            </div>
            <div id="tf_div_tagsDrop">
                <div id="tf_dropBox"></div>
            </div>
        </div>
        <div id="tagFun_div_helper">
        <!-- this is where the helper gets appended for temporary use -->
        </div>
    </body>
    </html>
    

    I pasted my entire code so you can try it out. Here is a brief description:
    When you start to drag an item it hides the original, clones it, then appends the clone to a container outside the overflow area. Once dropped it removes the original and moves the clone into the drop zone. Great so now we have fixed that overflow issue but run into some others. When you drop the clone item into the drop zone it disappears. To stop that from happening I used this method:

    $.ui.ddmanager.current.cancelHelperRemoval = true;
    

    Now we have stopped the helper from being removed but it remains in “div#tagFun_div_helper” while the original draggable item has reappeared.

    ui.helper.appendTo(this);
    

    This will transfer the helper from “div#tagFun_div_helper” into our drop zone.

    dropped = true;
    

    This will tell our stop function to delete the original item from the group instead of removing the “.hide” class. Hope that helps!

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

Sidebar

Ask A Question

Stats

  • Questions 306k
  • Answers 306k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Setting style doesn't eliminate all the elements in the CSS… May 13, 2026 at 9:21 pm
  • Editorial Team
    Editorial Team added an answer No, at least not in a portable way. GCC's libstdc++… May 13, 2026 at 9:21 pm
  • Editorial Team
    Editorial Team added an answer In this case I thing the sender will be the… May 13, 2026 at 9:21 pm

Related Questions

I have frequent need to test that XML files are correct and need a
Im trying to think how to do this with html elements. There is nothing
I am building a menu in HTML/CSS/JS and I need a way to prevent
I'm trying to figure out how to map an IDictionary property in fluent 1.0
I have two models: releases have many elements, and elements belong to releases. The

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.