Check out these code samples: http://jsfiddle.net/5r3Eh/10/show/ and http://jsfiddle.net/5r3Eh/18/. I've noticed they are running slow on Chrome 12, slightly improved on 13.
Is there a way to achieve drag-and-drop functionality for windows without using jquery.event.drag-1.5.min.js or even without jQuery at all? How can this be implemented in my basic code here: http://jsfiddle.net/5r3Eh/10/:
$('#demo4_box').bind('dragstart', function(event) {
return $(event.target).is('.handle');
}).bind('drag', function(event) {
$(this).css({
top: event.offsetY,
left: event.offsetX
});
});
$(".resize").bind('dragstart', function(event) {
var $box = $(this).closest(".box");
$box.data("width", $box.width());
$box.data("height", $box.height());
$box.data("x", event.offsetX);
$box.data("y", event.offsetY);
}).bind("drag", function(event) {
var $box = $(this).closest(".box");
$box.width(Math.max($box.data("width") - $box.data("x") + event.offsetX, $box.data("minwidth")));
$box.height(Math.max($box.data("height") - $box.data("y") + event.offsetY, $box.data("minheight")));
});