I am in need of \"Sortable Drag & Drop\" functionality and I\'m using jQuery. I can\'t really use jQuery UI, because for this project it would be an overhead (I\'d need to a
If you want no frills one then I found this one the best: http://jsfiddle.net/erikdana/Nkykq/3/ upto http://jsfiddle.net/erikdana/Nkykq/6/
very very light and up to the point.
js
$('#box').bind({
mousedown: function() {
$(document).mousemove(function(e) {
$('#box').css({
top: e.pageY - 10,
left: e.pageX - 20
});
});
},
mouseup: function() {
$(document).unbind(mousedown);
var box = $('#box').css('top');
if (box > '100') {
$('#box').css({width: '100px'});
};
}
});
css
div {width:50px;height:50px;background:blue;position:absolute; cursor:move;}
div:focus { cursor:move;}