I've been trying to get the sortable function to work, searched a lot of articles but so far no success.
The basics are just get the simple ul to bee sortable like the nice example on jqueryui The problem being, i'm doing everything as suggested but it's just ignoring me.
here is what i currently have: /
html:
<ul id="sortable">
<li id="item_1">bla</li>
<li id="item_2">bla</li>
</ul>
js in the onload(and no onload is not in fact the problem)
$(function () {
$('#sortable').droppable({
tolerance: 'touch',
drop: function () {
alert('delete!');
}
});
$('#item').sortable();
});
EDIT: ah got it, was using a wrong jquery ui lib
I've been trying to get the sortable function to work, searched a lot of articles but so far no success.
The basics are just get the simple ul to bee sortable like the nice example on jqueryui. The problem being, i'm doing everything as suggested but it's just ignoring me.
here is what i currently have: http://jsfiddle/N63qQ/
html:
<ul id="sortable">
<li id="item_1">bla</li>
<li id="item_2">bla</li>
</ul>
js in the onload(and no onload is not in fact the problem)
$(function () {
$('#sortable').droppable({
tolerance: 'touch',
drop: function () {
alert('delete!');
}
});
$('#item').sortable();
});
EDIT: ah got it, was using a wrong jquery ui lib
Share Improve this question asked Nov 1, 2013 at 10:38 Mark ProssMark Pross 451 gold badge1 silver badge8 bronze badges1 Answer
Reset to default 5it should be sortable, not dropable. Here is your code http://jsfiddle/N63qQ/4/
$(function () {
$('#sortable').sortable({
tolerance: 'touch',
drop: function () {
alert('delete!');
}
});
$('#item').sortable();
});
You also forgot to include Jquery UI in your code