Reputation: 1043
I just tried to create a Drag re-sizable layout with jQuery ui
But my actual aim was something like this
Is it possible to make it with jQuery Ui method ?, or any other plugins available
Upvotes: 7
Views: 4352
Reputation: 13360
Set the handles
property of the divs: http://jsfiddle.net/3zLRJ/5/
You'll need to add code to adjust both divs when one is being resized, though, through the resize
event.
Another option is to create a third div between the two, make it a draggable
, and constrain its motion to only go side to side. Then, adjust the divs around it on the drag
event.
Upvotes: 1
Reputation: 7229
The plugin doesn't support it by default, so I made a start for you to achieve the goal. I just hard coded the div's into the function for the resize event
, it's up to you to make it dynamic ;).
var total_width = 500;
$("#div1").resizable({
grid: [1, 10000]
}).bind( "resize", resize_other);
function resize_other(event, ui) {
var width = $("#div1").width();
if(width > total_width) {
width = total_width;
$('#div1').css('width', width);
}
$('#div2').css('width', (total_width - width));
}
Hope this helps!
Upvotes: 5