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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:49:39+00:00 2026-05-21T16:49:39+00:00

I have several li floating left, I know that I can identify the ID

  • 0

I have several li floating left, I know that I can identify the ID of the “next” li by using:

$("li").live("click",function(e) {
    alert($(this).next("li").attr('id'))
});

When you click an li it will display the ID of the next li.

But how do you display the ID of the next li’s, next li?

For example,

If I have:

1 2 3 4 5 6

And I move the number 2 to make:

1 3 4 5 2 6

How do I return that the “next” value to 1 has changed to 3, the “next” value to 2 has changed to 6 and the “next” value to 5 has change to 2?

In other words, how will I know what numbers “next” value has changed?

I am asking because I need to be able to identify these values and store them in a database so that I can load the page and echo the li’s in the correct floated order using PHP if they are rearranged. I will be using ajax of course to send these values to a PHP page.

Here is the document:

http://jsfiddle.net/TSM_mac/uuHsg/2/

Also, I am using alert(something…) to display the results.

Is there any type of “onrelease” or similar command that will only display the values after the objects are rearranged?

Thanks tons,

taylor

  • 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-21T16:49:39+00:00Added an answer on May 21, 2026 at 4:49 pm

    I’m not completely clear on what you’re trying to accomplish, but the sortable widget does have a change event handler that you can tap into to determine when a sortable element’s position in the DOM has changed:

    $("#sortable").sortable({
        change: function() { ... }
    });
    

    I’ve worked on a few projects where we have to allow the user to sort items, saving that sort to the database. I would let your server-side code handle that logic and pass up the new order (either by listening to the change event or the stop event).

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

Sidebar

Related Questions

So I have this Java program that I use to munch through several terabytes
I have a fairly complicated function that takes several double values that represent two
There have been several questions posted to SO about floating-point representation. For example, the
I have a number of divs floating in several rows. The divs contain text-previews
I have a DIV container with several inner DIVs layed out by floating them
I have several RequiredFieldValidators in an ASP.NET 1.1 web application that are firing on
We have several jobs that run concurrently that have to use the same config
I have several old 3.5in floppy disks that I would like to backup. My
I have several applications that are part of a suite of tools that various
I have a div containing several other divs with setting float:left. Now I want

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.