mustafa1993
mustafa1993

Reputation: 561

Drag and drop using JqueryUI not working

Am following : http://jqueryui.com/sortable/#connect-lists

Implemented everything as it is. Still drag and drop not working at all. Trying for 2 days. Here is the code inside head:

<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>

<style>
  #sortable1, #sortable2 {
    border: 1px solid #eee;
    width: 142px;
    min-height: 20px;
    list-style-type: none;
    margin: 0;
    padding: 5px 0 0 0;
    float: left;
    margin-right: 10px;
  }
  #sortable1 li, #sortable2 li {
    margin: 0 5px 5px 5px;
    padding: 5px;
    font-size: 1.2em;
    width: 120px;
  }
</style>
<script>
  $(function() {
    $( "#sortable1, #sortable2" ).sortable({
      connectWith: ".connectedSortable"
    }).disableSelection();
  });
</script>

And body :

<ul id="sortable1" class="connectedSortable">
  <li class="ui-state-default">Item 1</li>
  <li class="ui-state-default">Item 2</li>
  <li class="ui-state-default">Item 3</li>
  <li class="ui-state-default">Item 4</li>
  <li class="ui-state-default">Item 5</li>
</ul>

<ul id="sortable2" class="connectedSortable">
  <li class="ui-state-highlight">Item 1</li>
  <li class="ui-state-highlight">Item 2</li>
  <li class="ui-state-highlight">Item 3</li>
  <li class="ui-state-highlight">Item 4</li>
  <li class="ui-state-highlight">Item 5</li>
</ul>

Please help me out.

Upvotes: 1

Views: 181

Answers (3)

Ishimdar Ahamad
Ishimdar Ahamad

Reputation: 202

Use this, You forgot using http:

Code

<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>

Upvotes: 1

Murtaza Munshi
Murtaza Munshi

Reputation: 1085

Use Firebug addon in Firefox to to see Console Errors. It will help you resolve the errors.

See if it helps.

Upvotes: 0

mustafa1993
mustafa1993

Reputation: 561

I figured out. Thanks for suggesting firebug.

I was omitting http: in my link:

  <script src="//code.jquery.com/jquery-1.10.2.js"></script>

But this what I copied from tutorial link I mentioned above. Dont why they presented it as such.

Upvotes: 1

Related Questions