I am trying to create an ordered list of items that can be clicked and dragged using the Sortable jQuery UI plugin version 1.8.16 parameter. However, I keep getting an error that is $("#ol-id ol").sortable is not a function , with 'ol-id' being the list identifier. My code is as follows:
//Sorting stuff if($("#li-id li").size()>1) { $("#ol-id ol").sortable({ revert: true, axis: 'y', containment: 'parent', cursor: 'move', handle: 'div.link_div', smooth: false, opacity: 0.7, tolerance: 'pointer', start: function(){ $("#ol-id").removeClass("bottom_dragged"); }, update: function(){ $("#ol-id ol").sortable({disabled : true}); $("#saving_indicator").html("saving...") $("#saving_indicator").show(); //do other stuff... } }) }
Oddly enough, the error appears in Firebug as being on the line with update: function(){ .
I checked that this function is called after loading the page and loading the jQuery UI library. I include jquery-1.6.2.min.js and jquery-ui-1.8.16.custom.min.js in the header. Moreover, I have confirmed that all identifier names are correct and correspond to their HTML copies.
So, if this is not a missing resource-related substance, what causes the problem?
EDIT: here is my HTML header:
<link href="/_css/styles.css?mod=1317745564" type="text/css" rel="stylesheet"> <link href="/_javascript/qtip/jquery.qtip.min.css?mod=1315947301" type="text/css" rel="stylesheet"> <script type="text/javascript" async="" src="http://www.google-analytics.com/ga.js"> <script type="text/javascript" async="" src="http://www.google-analytics.com/ga.js"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"> <link rel="stylesheet" type="text/css" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/start/jquery-ui.css"> <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/le-frog/jquery-ui.css"> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js" type="text/javascript"> <script src="/_javascript/sets.js?mod=1320080042" type="text/javascript"> //Sorting stuff code is here <script type="text/javascript" src="http://dev.selfcheck.vudat.msu.edu/_javascript/jquery.jsonp.js"> <script type="text/javascript" src="http://dev.selfcheck.vudat.msu.edu/_javascript/jquery.form.js"> <script type="text/javascript" src="http://dev.selfcheck.vudat.msu.edu/_javascript/qtip/jquery.qtip.min.js"> <link href="/_css/ui/ui.core.css?mod=1315947279" type="text/css" rel="stylesheet"> <link href="/_css/ui/ui.theme.css?mod=1315947280" type="text/css" rel="stylesheet">
source share