[Solved] Up and Down rows from table

Just change appendTo() to insertBefore() and insertAfter() $(document).ready(function() { $(“#table1 tbody tr”).click(function() { $(this).toggleClass(‘selected’); }); }); $(document).ready(function() { $(“#table2 tbody tr”).click(function() { $(this).toggleClass(‘selected’); }); }); $(document).ready(function() { $(“.down”).click(function() { $(‘#table1 tr’).each(function() { if ($(this).attr(‘class’) == ‘selected’) { $(this).insertAfter($(this).nextAll(‘:not(.selected)’).eq(0)); } }); }); }); $(document).ready(function() { $(“.up”).click(function() { $(‘#table1 tr’).each(function() { if ($(this).attr(‘class’) == ‘selected’) { $(this).insertBefore($(this).prevAll(‘:not(.selected)’).eq(0)); … Read more

[Solved] Delphi, How to make a shape stop moving

Try the following code (assign OnCreate and OnPaint of the form and set the timer to 30 millisecond intervals): unit Unit5; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls; type TVector = record X, Y: real; end; TForm5 = class(TForm) Timer1: TTimer; procedure FormPaint(Sender: TObject); procedure FormCreate(Sender: TObject); procedure Timer1Timer(Sender: TObject); … Read more