jQuery UI - Sortable isn't firing?
Posted
by Kenny Bones
on Stack Overflow
See other posts from Stack Overflow
or by Kenny Bones
Published on 2010-05-17T14:32:10Z
Indexed on
2010/05/17
15:20 UTC
Read the original article
Hit count: 264
Hi, I'm trying to get the jQuery UI sortable plugin to work and I've created a list that looks like this:
<ul id="sortable">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
<li>Item 5</li>
</ul>
And I've included the plugin script files:
$(function() {
$("#sortable").sortable();
alert('test');
$("#sortable").disableSelection();
});
So I just tried putting the alert box before .sortable is run and the alertbox is showing. But putting it after .sortable isn't working. Which means that .sortable is failing right?
I've included the scripts and put them in the head of the html document.
<script type="text/javascript" src="js/jquery.ui.core.min.js"></script>
<script type="text/javascript" src="js/jquery.ui.mouse.min.js"></script>
<script type="text/javascript" src="js/jquery.ui.sortable.min.js"></script>
<script type="text/javascript" src="js/jquery.ui.widget.min.js"></script>
Which is correct right? And the function that actually runs .sortable is in a merged js file along with all other js snippets and plugins.
© Stack Overflow or respective owner