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

The Archive Base Latest Questions

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

I have place my sample at the below location : http://jsbin.com/axegem/1 Here is the

  • 0

I have place my sample at the below location : http://jsbin.com/axegem/1

Here is the scenario. When I drag the divs and drop them on to another place, I need to retrieve the new order of the divs. For example, lets say (with respect to my sample), I dragged and dropped DIV 3 after DIV 6. Now I am trying to get the new order of the divs. For testing, I am alerting their html text in the following code:

$(".draggable").each(function(){
  alert($(this).html());
});

I am expecting the alert order to be: DIV 1, DIV 2, DIV 4, DIV 5, DIV 6, DIV 3, DIV 7, DIV 8, DIV 9. But what I get in the sample is DIV 1, DIV 2, DIV 3, DIV 4, DIV 5, DIV 6, DIV 7, DIV 8, DIV 9.

How can I get the new order of the divs after dropping them in a new location?

  • 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-18T04:25:38+00:00Added an answer on June 18, 2026 at 4:25 am

    I have change a little your code to fit your needs.

    I have change to using Sortable functionality, that’s because you have used the draggable the only drug not sort elements.

    When you use the Sortable it will be easily to get the sorted elements

    $(document).ready(function() {
        $('#divOuter2').css("margin","-540px 0 0 400px");
        $('#divOuter3').css("margin","-540px 0 0 800px");
    
        $(".droppable").sortable({
          update: function( event, ui ) {
            Dropped();
          }
        });
    
    
    
      });
    
    
    
        function Dropped(event, ui){
          $(".draggable").each(function(){
            //var p = $(this).position();
            alert($(this).html());
          });
          refresh();
        }
    

    I have set the DOM element with class .droppable as sortable.

    Then on Update Event i am calling your function Dropped

    See Example

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

Sidebar

Related Questions

I have a simple UserControl as below - that I place in a Canvas.
I have a test case here: http://www.libsys.und.edu/dev/scroll-test.html It has a DIV containing a very
I am still learning Sweave and R . I have below a sample code
many Places in the sample code i have seen 2 different way of @synthesize
We have place a button on a view. When we press it, nothing happens.
In my string I have place holders like: ##NEWSLETTER## , ##FOOTER# ##GOOGLEANALYTICS## etc. Each
We have a place in a code of such form: void processParam(Object param) {
I have a place in my Django app where I need to construct a
I have one requirement that i have to place the log file in the
In what directory do I have to place my themes.xml in order that my

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.