Перемещение элементов стрелками ajax jquery

514
.
Koenig, если есть, он выводит все записи и стрелочками мы их перемещаем. Перемещение делаем с помощью Jquery. Вроде не сложно делать.
.
Кадило крутится, лавэха мутится
$(document).on('click', '.move_list', function () {
    $.ajax({
        type: "GET",
        url: $(this).attr('href'),
        dataType: 'html',
        data: '',
        success: function (data) {
            $('#list').html($(data).find('#list').html());
        }
    });
});

Думаю всё понятно..
.
Всем спасибо. Будем разбирать)
.
<tbody id="categoryRecords">
                   <tr id="6">  <td> 6</td><td>National Event Days</td><td class="actions-wide"> <a class="waves-effect waves-light btn blue edit-button"><i class="mdi mdi-pencil left"></i>Edit</a>
                      <a class="waves-effect waves-light btn red delete-button"><i class="mdi mdi-delete left"></i>Delete</a> </td><td><a href="/index.php?up=8&amp;to=7&amp;i=0"><img src="img/up.png" title="up"></a> <a href="/index.php?down=8&amp;to=9&amp;i=0"><img src="img/down.png" title="down"></a></td></tr> <tr id="8">  <td> 8</td><td>Soccer - Rep of Ire Football</td><td class="actions-wide"> <a class="waves-effect waves-light btn blue edit-button"><i class="mdi mdi-pencil left"></i>Edit</a>
                      <a class="waves-effect waves-light btn red delete-button"><i class="mdi mdi-delete left"></i>Delete</a> </td><td><a href="/index.php?up=9&amp;to=8&amp;i=1"><img src="img/up.png" title="up"></a> <a href="/index.php?down=9&amp;to=10&amp;i=1"><img src="img/down.png" title="down"></a></td></tr> <tr id="9">  <td> 9</td><td>Soccer - Champions League</td><td class="actions-wide"> <a class="waves-effect waves-light btn blue edit-button"><i class="mdi mdi-pencil left"></i>Edit</a>
                      <a class="waves-effect waves-light btn red delete-button"><i class="mdi mdi-delete left"></i>Delete</a> </td><td><a href="/index.php?up=10&amp;to=9&amp;i=2"><img src="img/up.png" title="up"></a> <a href="/index.php?down=10&amp;to=11&amp;i=2"><img src="img/down.png" title="down"></a></td></tr> <tr id="10">  <td> 10</td><td>Soccer - Europa League</td><td class="actions-wide"> <a class="waves-effect waves-light btn blue edit-button"><i class="mdi mdi-pencil left"></i>Edit</a>
                      <a class="waves-effect waves-light btn red delete-button"><i class="mdi mdi-delete left"></i>Delete</a> </td><td><a href="/index.php?up=11&amp;to=10&amp;i=3"><img src="img/up.png" title="up"></a> <a href="/index.php?down=11&amp;to=12&amp;i=3"><img src="img/down.png" title="down"></a></td></tr> <tr id="12">  <td> 12</td><td>Soccer - Euro 2016 Finals</td><td class="actions-wide"> <a class="waves-effect waves-light btn blue edit-button"><i class="mdi mdi-pencil left"></i>Edit</a>
                      <a class="waves-effect waves-light btn red delete-button"><i class="mdi mdi-delete left"></i>Delete</a> </td><td><a href="/index.php?up=12&amp;to=11&amp;i=4"><img src="img/up.png" title="up"></a> <a href="/index.php?down=12&amp;to=13&amp;i=4"><img src="img/down.png" title="down"></a></td></tr> <tr id="13">  <td> 13</td><td>World Cup Qualifiers 2018</td><td class="actions-wide"> <a class="waves-effect waves-light btn blue edit-button"><i class="mdi mdi-pencil left"></i>Edit</a>
                      <a class="waves-effect waves-light btn red delete-button"><i class="mdi mdi-delete left"></i>Delete</a> </td><td><a href="/index.php?up=13&amp;to=12&amp;i=5"><img src="img/up.png" title="up"></a> <a href="/index.php?down=13&amp;to=14&amp;i=5"><img src="img/down.png" title="down"></a></td></tr> <tr id="14">  <td> 14</td><td>Rugby - Pro 12 Irish teams</td><td class="actions-wide"> <a class="waves-effect waves-light btn blue edit-button"><i class="mdi mdi-pencil left"></i>Edit</a>
                      <a class="waves-effect waves-light btn red delete-button"><i class="mdi mdi-delete left"></i>Delete</a> </td><td><a href="/index.php?up=14&amp;to=13&amp;i=6"><img src="img/up.png" title="up"></a> <a href="/index.php?down=14&amp;to=15&amp;i=6"><img src="img/down.png" title="down"></a></td></tr> <tr id="15">  <td> 15</td><td>Rugby - 6 Nations</td><td class="actions-wide"> <a class="waves-effect waves-light btn blue edit-button"><i class="mdi mdi-pencil left"></i>Edit</a>
                      <a class="waves-effect waves-light btn red delete-button"><i class="mdi mdi-delete left"></i>Delete</a> </td><td><a href="/index.php?up=15&amp;to=14&amp;i=7"><img src="img/up.png" title="up"></a> <a href="/index.php?down=15&amp;to=16&amp;i=7"><img src="img/down.png" title="down"></a></td></tr> <tr id="16">  <td> 16</td><td>Rugby - World Cup</td><td class="actions-wide"> <a class="waves-effect waves-light btn blue edit-button"><i class="mdi mdi-pencil left"></i>Edit</a>
                      <a class="waves-effect waves-light btn red delete-button"><i class="mdi mdi-delete left"></i>Delete</a> <td><a href="/index.php?up=36&amp;to=35&amp;i=29"><img src="img/up.png" title="up"></a> <a href="/index.php?down=36&amp;to=37&amp;i=29"><img src="img/down.png" title="down"></a></td></tr>                </tbody>


на примере этого html кода можете написать js для перемещения ?
.
Simba
Кадило крутится, лавэха мутится
naster, Ссылкам для перемещения строк добавь класс move_str
$(document).on('click', '.move_str', function (event) {
    event.preventDefault();
    $.ajax({
        type: "GET",
        url: $(this).attr('href'),
        dataType: 'html',
        data: '',
        success: function (data) {
            $('#categoryRecords').html($(data).find('#categoryRecords').html());
        }
    });
});
.
Добавил, но нечего не происходит
.
Что делает это js код?
Всего: 27