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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:35:15+00:00 2026-05-11T08:35:15+00:00

I’ve used JQuery to make the elements in a table draggable. (I’ve never used

  • 0

I’ve used JQuery to make the elements in a table draggable. (I’ve never used JQuery before this). It works fine, but is very slow. For example, from the moment I click and hold on an item, to the moment the cursor changes is about 2 seconds. This is on Firefox 3.0.6. Once the item is being dragged, there’s a shorter, but still noticeable delay (about half a second, I’d estimate) between when I let go of the mouse button and when the drop visibly takes place.

I suspect that the reason it’s so slow is because the table is quite big (6 columns and about 100 rows), but it doesn’t seem to me that it’s obscenely big, and I wonder if there’s something dumb I’m doing that is making it so slow. For example, I wonder if the JQuery code is being pointlessly applied to every element in the table each time you drag something. I don’t know why that would happen, though.

In case it helps, here’s my code (note that I’ve taken out the cursor call, as I was afraid it might be slowing things down).

<script type='text/javascript'>   $(document).ready   (     function()     {       $('.draggable_div').draggable       (         {           start: function(event, ui)           {             $(this).css('background-color','#ddddff');           }         }       );       $('.draggable_td').droppable       (         {           over: function(event, ui)           {             $(this).css('background-color', '#ccffcc');           },           out: function(event, ui)           {             $(this).css('background-color', null);           },           drop: function(event, ui)           {              // snip: removed code here to save space.            }         }       );     }   ); </script> 

The HTML table is like this (as generated by PHP):

<table id='main_table' border=0> <tr>   <th width=14.2857142857%>0</th>   <th width=14.2857142857%>1</th>   <th width=14.2857142857%>2</th>   <th width=14.2857142857%>3</th>   <th width=14.2857142857%>4</th>   <th width=14.2857142857%>5</th>   <th width=14.2857142857%>6</th> </tr> <tr>   <td class=draggable_td id='td:0:0:'>   <div class=draggable_div id='div:0:0:1962'>     content   </div>   </td>   <td class=draggable_td id='td:0:1:1962'>   <div class=draggable_div id='div:0:1:14482'>     content   </div>   </td>   <!-- snip: all the other cells removed for brevity --> </tr> <!-- snip: all the other rows removed for brevity --> </table> 

(Note: it doesn’t seem to work at all in IE 7, so perhaps I’m just doing something very wrong here…)

  • 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. 2026-05-11T08:35:15+00:00Added an answer on May 11, 2026 at 8:35 am

    The presence of so many drop targets seems to make the performance so slow. If possible, try setting the table as a single drop target and calculate the target table cell based on the position data in the drop event.

    Unfortunately, you will also lose the ability to apply styles to individual cells on dragOver and dragOut events.

    Edit: Another suggestion is to disable droppable on all tds and upon mouseover of a tr, enable the droppables of tds present in the specific tr (and disable them back upon mouseout of tr). Sounds like a hack, but worth a try.

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

Sidebar

Ask A Question

Stats

  • Questions 278k
  • Answers 278k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If you don't mind using some private stuff, you can… May 13, 2026 at 3:17 pm
  • Editorial Team
    Editorial Team added an answer I always like the idea of making games to learn… May 13, 2026 at 3:17 pm
  • Editorial Team
    Editorial Team added an answer One possible solution is to add the shortcut in as… May 13, 2026 at 3:17 pm

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a French site that I want to parse, but am running into
I have text I am displaying in SIlverlight that is coming from a CMS

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.