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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:50:45+00:00 2026-05-17T20:50:45+00:00

Current Problem In relearning jQuery/jQueryUI, I’m trying to call an event on an element

  • 0

Current Problem


In relearning jQuery/jQueryUI, I’m trying to call an event on an element after sorting it. This is probably relatively simple to do since jQuery has many ways to implement callbacks.

jQuery(document).ready(function($) {
  $('ul').addClass('list-unstyled');
  $('.sortable').sortable({
    revert: true,
    connectWith: ".sortable"
  });
});
ul {
  margin: .8rem 2rem !important;
}

li {
  margin: 0;
  padding: 0;
}

div>div {
  border: 1px solid #999;
  margin-bottom: 2px;
}

body {
  padding: 1rem;
}

.sortable {
  cursor: pointer;
}

.sortable>div:hover {
  background: #f0f0f0;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js" integrity="sha256-Bxxp5LTCU2v12w2d0kxKb0vt5F4EgtrzcJKJSR3Xxio=" crossorigin="anonymous"></script>

<div class="sortable">
  <div>
    <ul class="1">
      <li>test 1</li>
      <li>test 2</li>
    </ul>
  </div>
  <div>
    <ul class="2">
      <li>test 3</li>
      <li>test 4</li>
    </ul>
  </div>
</div>
<div class="sortable">
  <div>
    <ul class="3">
      <li>test 7</li>
      <li>test 8</li>
    </ul>
  </div>
  <div>
    <ul class="4">
      <li>test 9</li>
      <li>test 0</li>
    </ul>
  </div>
</div>

So let’s say I move the 3/4 list. I want to issue a callback (to change the background or the font size) after the element is finished moving.

Edit(s)


  • 20101019-1145EST: I think I need to be more clear. I’m trying to call the event on a particular element that is sorted. I guess I might be able to use the sort/change function, but shouldn’t there be a conditional involved? This involves more than adding a class, the eventual function I plan to attach will perform some AJAX as well as some calculations.
  • 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-17T20:50:45+00:00Added an answer on May 17, 2026 at 8:50 pm

    Use the stop event of the sortable plugin.

    This event is triggered when sorting
    has stopped.

    In your example

    $('.sortable')
        .sortable({
           revert       : true,
           connectWith  : ".sortable",
           stop         : function(event,ui){ /* do whatever here */ }
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My problem is that RichFaces reRender does not work 'under' the current element in
My current problem is that I have a JFrame with a 2x2 GridLayout. And
I came across a problem in my current application that required fiddling with the
Here is my current question: I'm guessing that my problem (described below) is being
Is it a deliberate design decision or a problem with our current day browsers
Problem, there's no method: bool ChangePassword(string newPassword); You have to know the current password
I have a strange problem when I try to deploy my current app to
I just finished working out a memory allocation problem with the current program I'm
Current, I've got a stored procedure that has a main goal of doing a
My current development project has two aspects to it. First, there is a public

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.