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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:26:46+00:00 2026-05-27T12:26:46+00:00

I have a jQuery UI draggable, and I’ve tried to create a custom helper

  • 0

I have a jQuery UI draggable, and I’ve tried to create a custom helper which would contain some but not all information of the original element.

Here’s my draggable elements;

<ul>
  <li><div>Name</div> <span>12-12-2011</span></li>
  <li><div>Another name</div> <span>12-12-2011</span></li>
</ul>

And jQuery;

$("ul li").draggable(function(){
  helper: function(){
    return $("<div></div>");
  }
});

The idea would be that while dragging, the user would have a helper that contains only the name, but not the time element.

My actual code is slightly more complex than this even, so what I’m really looking for is any selector that would allow me to select the original element, or a copy of it, and then do all kinds of jQuery magic on it (filtering elements, adding new elements, classes, etc.)

However, for my life I can’t find this, the documentation of draggable sucks and nobody at #jquery would help me. Any ideas?

Thanks in advance!

  • 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-27T12:26:46+00:00Added an answer on May 27, 2026 at 12:26 pm

    First your way of calling draggable is faulty. The expected parameter is an object literal, not a function.

    this is the currently dragged element in the helper function.

    Having the following html

    <ul>
      <li><div class="name">Name</div> <span>12-12-2011</span></li>
      <li><div class="name">Another name</div> <span>12-12-2011</span></li>
    </ul>
    

    You can do this:

    $('ul li').draggable({
        helper: function() {
            //debugger;
            return $("<div></div>").append($(this).find('.name').clone());
        }
    });
    

    Note: I have added class to the <div> representing the name for the sake of selecting it but you can find any other way to do so.

    Here’s a jsfiddle for you to check.

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

Sidebar

Related Questions

I have jquery validation code which is working fine in ff but the same
I have a jquery ui draggable div, and the HTML contents do not behave
I have elements on the page which are draggable with jQuery. Do these elements
I would like to achieve the ease effect with Jquery's draggable. But I did
I have two li elements which are jQuery draggable. When I drag and drop
I have a div, which has jQuery UI Draggable applied. What I want to
I have jquery draggable/droppable working with the containment and helper options set. What I'd
I have the following jQuery: $(document).ready(function () { $(.element).draggable(); $(.element).droppable({ drop: function () {
I have jQuery code which looks something like this on Button1 Click $('table.result_grid tbody
I have jQuery to select all font elements that are children of the element

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.