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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:37:18+00:00 2026-06-09T22:37:18+00:00

In jQuery UI sortable accordian, how do I handle the item release event? I

  • 0

In jQuery UI sortable accordian, how do I handle the item release event?
I tried this:

$('#accordion').mousedown(function() {
    alert('Handler for .mousedown() called.');
});

But the result is not correct. The item is always sticking to the mouse… On mouse down, the popup shows, and if you click ok, the item is still sticking to the mouse.

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <title>jQuery UI Example Page</title>
        <link type="text/css" href="css/ui-lightness/jquery-ui-1.8.23.custom.css" rel="stylesheet" />
        <script type="text/javascript" src="js/jquery-1.8.0.min.js"></script>
        <script type="text/javascript" src="js/jquery-ui-1.8.23.custom.min.js"></script>

        <style>
        /* IE has layout issues when sorting (see #5413) */
        .group { zoom: 1 }
        </style>
        <script>
        $(function() {
            $( "#accordion" )
                .accordion({
                    header: "> div > h3"
                })
                .sortable({
                    axis: "y",
                    handle: "h3",
                    stop: function( event, ui ) {
                        // IE doesn't register the blur when sorting
                        // so trigger focusout handlers to remove .ui-state-focus
                        ui.item.children( "h3" ).triggerHandler( "focusout" );
                    }
                });
        });


        function show_progress() {
            var items = $('.group', '#accordion');
            for(var i=0; i<items.length; i+=1) {
                alert(items[i].innerHTML);
            }
        }


        </script>

        <div id="accordion">
            <div class="group">
                <h3><a href="#">Section 1</a></h3>
                <div>
                    <a href="#">Edit Item</a>
                    <span class="svr_rlv_url"></span>
                </div>
            </div>
            <div class="group">
                <h3><a href="#">Section 2</a></h3>
                <div>
                    <a href="#">Edit Item</a>
                    <span class="svr_rlv_url"></span>
                </div>
            </div>
            <div class="group">
                <h3><a href="#">Section 3</a></h3>
                <div>
                    <a href="#">Edit Item</a>
                    <span class="svr_rlv_url"></span>
                </div>
            </div>
            <div class="group">
                <h3><a href="#">Section 4</a></h3>
                <div>
                    <a href="#">Edit Item</a>
                    <span class="svr_rlv_url"></span>
                </div>
            </div>
        </div>

        <br/>

        <a href="#" onclick="show_progress();">CLICK</a>

        <script>
            $('#accordion').mousedown(function() {
              alert('Handler for .mousedown() called.');
            });
        </script>

    </body>
</html>
  • 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-09T22:37:20+00:00Added an answer on June 9, 2026 at 10:37 pm

    You should not alert in the middle of a script, this is what happens in the script:

    • Mouse down – item gets draggable
    • alert – javascript PAUSES
    • You release your mouse to click the ok, but javascript does not know this because the script is paused
    • when the alert is closed, javascript still thinks you are holding your mouse button down, so the item sticks to your mouse.

    Just remove the alert and do console.log('Handler for .mousedown() called.'); instead

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

Sidebar

Related Questions

I want to have something similar to the sortable accordian in JQuery UI, that
I am implemented a jQuery UI sortable element. Here is my code: $(function() {
This should be my last question on Jquery Sortable...for a while :) I have
question: I am working with jQuery sortable. I used this tutorial: http://www.xmech.net/programming/jquery-ui-sortable-tutorial/ Now this
I am using the JQuery.Sortable() function to create a reorderable list of items like
I have this function in jquery which has the result array and how can
I am building a sortable accordion with jquery which works perfectly fine but I
If I do jquery sortable on a contenteditable items, the item would never be
jQuery UI Sortable + Draggable 1.6rc5 WHAT I AM DOING: Creating a calendar with
I'm using jQuery UI sortable plugin to be able to select and sort items.

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.