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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:29:41+00:00 2026-06-09T16:29:41+00:00

I want to make jquery UI elements to disappear when dragged outside of a

  • 0

I want to make jquery UI elements to disappear when dragged outside of a container.

For example Say I have one list of

<div class="myfavoritecontainer">
   <ul class="sortable">
   <li>item1</li>
   <li>item2</li
  </ul> 
</div>

and the sortable is turned into a jquery ui sortable… Now, when I drag these items out of the sort list I want to make them disappear… Whats the best way to accomplish?

A little clarification of what I’m trying to do:
Reference this jsfiddle: http://jsfiddle.net/nveid/kQmWt/4/

Basically items from the right list I’m adding to the list on the left(that parts done!), secondly items on the left part of the list when I drag outside of the left list I want to make them disappear. If you look at your js console while you drag the left side content you will see closely what I’m trying to accomplish.. But i’m just not accomplishing it because mouseenter is being triggered right after mouse left is triggered. The exact reason the event triggering is happening I don’t know but the fiddle should give some clarification.

Preferably I could make it so as soon as you mouse up from dragging the items on the left side outside of its div container they would disappear, but I’d setting for after they revert back to their original location the li item will disappear but the mouseenter/mouseleave events aren’t working right for me.

  • 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-09T16:29:43+00:00Added an answer on June 9, 2026 at 4:29 pm

    I looks like you need to use the beforeStop to remove items and maintain a sentinel based on the over and out to determine whether or not you’ve moved outside the bounds of the container. I’m basing this off the previous post here: Jquery Sortable, delete current Item by drag out

    The jsFiddle edits would look like this in the sortable dedinition:

            over: function(e, ui) { sortableIn = 1; },
            out: function(e, ui) { sortableIn = 0; },
            beforeStop: function (event, ui) {
                newItem = ui.item;
                if (sortableIn == 0) { 
                  ui.item.remove(); 
               }
            },
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have div elements, containing images. I want to make the div resizeable using
The jQuery plugin cycle looks for elements of class slideshow . I want to
I have a form where I want to make all new DOM elements of
I have an idea to make a list of elements and when you click
I have a collection of elements I want to show one after another, fading
I have an example: http://jsfiddle.net/kamaci/uVQZc/3/ When I animate bigger blue div, I want to
I've N number of <li> 's I want to make jquery slider to work
I want make datetimepicker in my project. Using jquery how it is possible? I
I want to make some clicks with Jquery dynamically onLoad of a page. I
i want to make a draggable image in jquery. first of all my experience

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.