My purpose is to split a certain timeline in divisions.
My only idea of doing it is by doing something like this:
Another thing I want to be able to do is resize them by dragging one end to the left or to the right, when this is done, the next one adjusts so they ocupy the same space.
Any division can be split further.
this is what I've come up with but I'm not pleased with it at all:
https://jsfiddle.net/syj6z05v/2/
$(function() {
$( "#resizable1" ).resizable({
containment: "#container"
});
$( "#resizable2" ).resizable({
containment: "#container"
});
$( "#resizable3" ).resizable({
containment: "#container"
});
});
$(function() {
var isDragging = false;
var okay = 0;
var next;
$(".a")
.mousedown(function() {
okay = 1;
isDragging = false;
})
.mousemove(function() {
if (okay == 1){
next = $(".a").next();
var width = 0;
$(this).parent().children().each(function() {
width += $(this).outerWidth( true );
});
next.width(next.parent().width() - (width - next.width()));
isDragging = true;
}
})
.mouseup(function() {
okay = 0;
isDragging = false;
});
});