-1

The URL : https://johnny.github.io/jquery-sortable/

I download and run it on localhost, but it's not working

I run example.html

My URL is like this : http://localhost/ngetest/drag_drop/source/example.html

The result :

I update example.html to be like this :

<style type="text/css">
    body.dragging, body.dragging * {
      cursor: move !important;
    }

    .dragged {
      position: absolute;
      opacity: 0.5;
      z-index: 2000;
    }

    ol.example li.placeholder {
      position: relative;
      /** More li styles **/
    }
    ol.example li.placeholder:before {
      position: absolute;
      /** Define arrowhead **/
    }
</style>

<ol class='example'>
  <li>First</li>
  <li>Second</li>
  <li>Third</li>
</ol>
<script src='js/jquery-sortable.js'></script>

<script type="text/javascript">
    $(function  () {
      $("ol.example").sortable();
    });
</script>

But just the same. It's not working

Thank you

moses toh
  • 10,726
  • 57
  • 212
  • 388

2 Answers2

1

Works perfectly fine:

$(function  () {
  $("ol.example").sortable();
});
body.dragging, body.dragging * {
  cursor: move !important;
}

.dragged {
  position: absolute;
  opacity: 0.5;
  z-index: 2000;
}

ol.example li.placeholder {
  position: relative;
  /** More li styles **/
}
ol.example li.placeholder:before {
  position: absolute;
  /** Define arrowhead **/
}
<script src="https://johnny.github.io/jquery-sortable/js/application.js"></script>

<ol class='example'>
  <li>First</li>
  <li>Second</li>
  <li>Third</li>
</ol>
Praveen Kumar Purushothaman
  • 160,666
  • 24
  • 190
  • 242
  • I need you help, Look here : http://stackoverflow.com/questions/35640041/how-to-validation-of-input-text-field-in-ajax?noredirect=1#comment58961736_35640041 – moses toh Feb 25 '16 at 23:59
1

The reason when it didn't work on localhost its because maybe you didn't include jQuery

$(function  () {
  $("ol.example").sortable();
});
      body.dragging, body.dragging * {
  cursor: move !important;
}

.dragged {
  position: absolute;
  opacity: 0.5;
  z-index: 2000;
}

ol.example li.placeholder {
  position: relative;
  /** More li styles **/
}
ol.example li.placeholder:before {
  position: absolute;
  /** Define arrowhead **/
}
<!DOCTYPE html>
<html>
<head>
 <title>Sortable</title>
</head>

<body>
   <ol class='example'>
   <li>First</li>
   <li>Second</li>
   <li>Third</li>
    </ol>

<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
<script type="text/javascript" src="https://johnny.github.io/jquery-sortable/js/jquery-sortable.js"></script>
</body>
</html>
Little Phild
  • 775
  • 1
  • 5
  • 17