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

  • Home
  • SEARCH
  • 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 9198355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:15:47+00:00 2026-06-17T22:15:47+00:00

What I have: Using jQuery UI, I’m dragging/dropping a div from one div to

  • 0

What I have:

Using jQuery UI, I’m dragging/dropping a div from one div to another.

The dropping event triggers:

  1. An animation that eases/snaps the dropped div into place.
  2. The toggling (show/hide) of yet another div.

The problem:

The toggling occurs before the animation is complete. I need the toggling to occur AFTER the animation completes.

Live example + code:

http://jsfiddle.net/dominornovus/3Hq3q/2/

What I’ve tried:

I’ve unsuccessfully attempted use of an animated selector:

$(":animated").promise().done(function() {
//code here
}

My question:

How do I prevent the toggle occurring before the droppable animation.

  • 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-17T22:15:48+00:00Added an answer on June 17, 2026 at 10:15 pm

    Use the callback in animate() :

    $('.drop').droppable({
        tolerance: 'intersect',
        drop: function(event, ui) {
            var drop_p = $(this).offset();
            var drag_p = ui.draggable.offset();
            var left_end = drop_p.left - drag_p.left + 1;
            var top_end = drop_p.top - drag_p.top + 1;
            ui.draggable.animate({
                top: '+=' + top_end,
                left: '+=' + left_end
            }, function() {  //callback
                $(".somediv").toggle();
            });
        }
    });
    

    FIDDLE

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

Sidebar

Related Questions

I have started using jQuery and rails. I have made a simple form that
I have a JQuery (using JQuery 1.4.2) problem that exhibits only in IE8 in
I have been using jQuery for some time and this one's stumping me- I
I am binding the click event to 4 href's (they have class=alink) using JQuery
I have started using jquery in one of my new asp.net webform application... I
I have been using JQuery mobile for a few days now and one thing
I have been using jQuery address plugin and it passes an event.value which might
I have been using jQuery overlays that appear to only work on jQuery version
I have been using Jquery alot lately an was wondering if I should use
I'm working on a asp.net mvc2 app. I have been using jquery to do

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.