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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:42:36+00:00 2026-06-18T03:42:36+00:00

I have some specific situation this: picture shows it very good. So I’m developing

  • 0

I have some specific situation this:
enter image description here
picture shows it very good. So I’m developing following actions:

  • Sortable Div has method .sortable() on itself. And sortable Items sorts well.
  • DroppableDiv has method .droppable() on itself. And DragItems has method .draggable() on theirself.

My issue

What I want to do is to handle sortable item on which was dropped DragItem from Container.
enter image description here

In this example I’m drag & drop DragItem 2 to Sortable Item 2. And I need to handle Sortable Item 2 within DroppableDiv.droppable({drop : function(event, ui) {}});.

I’ve searched event and ui object but I haven’t find solution there.

Also sorry I haven’t give anny fiddle but I have problem with create working example in jsfiddle/jsBin.

Any help would be appreciated.

  • 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-06-18T03:42:38+00:00Added an answer on June 18, 2026 at 3:42 am

    In this case I have wrote my own function:

    function findPosition(position) {
        var container = $("#DroppableDiv");
        var sortableItems = container.find("li");
        var searchedItem = null;
    
        for (var i = 0; i < sortableItems.length; i++) {
            var item = sortableItems.eq(i);
            var itemPosition = item.position();
            var itemWidth = item.css('width');
            var itemHeight = item.css('length');
    
            if (position.left < parseFloat(widgetPosition.left) + (parseFloat(widgetWidth) * 0.75) && position.top < parseFloat(widgetPosition.top) + (parseFloat(widgetHeight) * 0.75)) {
                searchedItem = widget;
                break;
            }
        }
    
        return searchedItem;
    }
    

    Which was called from:

        $("#DroppableDiv").droppable({
            accept: 'li',
            drop: function (event, ui) {
                //here is little trick for check is event comes from drag or sort(only in my case)
                if (ui.draggable.context.childElementCount === 0) {
                    var newWidgetPosition = findPosition(ui.position);
                }
            }
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So situation is following : We have some very old product, that has dozen
I have a directory named 'backup' its contains following files (with some specific details)
I don't have a specific situation I'm dealing with, so consider this more of
Admittedly, I am simply looking for some direction here. I have a specific situation,
I am combining div toggling with complex forms: http://railscasts.com/episodes/75-complex-forms-part-3 My specific situation: I have
The situation is this: I have some JavaScript that creates an interactive dialogue (and
I have some specific id like 1,2,5,11,64589 in solr (int type) I want to
I'm trying to filter some XML in JavaScript using E4X and have some specific
I have some photos in specific drive on a hard disk, these photos all
Details on fonts: When you have some text in specific font, there's a header

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.