jQuery UI - Sortable isn't firing?
- by Kenny Bones
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.