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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:50:40+00:00 2026-06-14T04:50:40+00:00

I created a basic jQuery script to allow dragging and dropping table rows to

  • 0

I created a basic jQuery script to allow dragging and dropping table rows to reorder them. Everything is working great – the only thing that I can’t figure out is how to create a ‘ghost’ image of the row while it is being dragged.

I tried cloning the row

$(this).clone().addClass('dragClone');

With the following CSS

.dragClone{opacity:0.4;position:absolute;z-index:1500;}

But nothing showed up. Figuring that the TR may need to exist within a table, I cloned the entire table, emptied the rows and appended the selected TR as follows:

$('.dragTable').clone().addClass('dragClone');$('.dragClone').find('tbody').empty().append($('.origZone'));

(origZone is the class that’s given to the TR being dragged)

Still nothing is showing up.

I’ve never used clone before, so I have no idea if I am even close, or on the right track at all! The goal is to create a ghost image similar to the one used in the Redips_drag plugin (http://www.redips.net/javascript/drag-and-drop-table-row/)

  • 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-14T04:50:41+00:00Added an answer on June 14, 2026 at 4:50 am

    I was able to solve this problem by doing the following:

    Creating an empty div on the page:

    if($('#dragContain').length<1){$('body').append('<div id="dragContain"style="width:96%;height:1px"></div>');}
    

    Saved the containing table to a variable, cloned it, removed the tbody contents and hid the thead, appended the row, which was saved as a variable, appended it to the previously mentioned div

    $table=$(this).closest('.dragTable');$row=$(this).closest('tr').clone();
    
    $table.find('tbody').remove();$table.find('thead').hide();$table.append($row);$('#dragContain').addClass('dragClone').append($table);
    

    I’m not sure if this was the best way to accomplish it, but it works.

    FYI – I had to use the following CSS to allow the hover affect to work on the underlying rows

    #dragContain{pointer-events:none;}
    

    Hope that this helps someone!

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

Sidebar

Related Questions

I created a very basic slideshow by repeating the jQuery effects with setInterval .
I created a basic calculator service called MiniCalc that only has two operations. Add
jQuery return links are not working. I have Used jQuery and the basic Ajax
Only just starting out with jQuery and I'm sure this is basic stuff for
I'm learning javascript and jquery and have written a very basic script inside my
I have a pretty basic jquery script which uses an h2 as a trigger
i only know basic javascript and not even basic jquery, but i would like
I currently have a very basic JQuery script accompanied by some CSS that helps
So I have an accordion menu that I created with Jquery: <script> $(document).ready(function() {
I have a Rails 3.2.2 application using Ruby version 1.9.2. I have created basic

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.