I have two columns that I would like to be resizable (whereby one gets wider the other becomes narrower) but I'm not really sure how to go about it. I have setup this fiddle: http://jsfiddle.net/4kyoyazq/
I have three columns at the moment, with one called "handle" that sits above (z-index) the others.
//left col
#content {
position:absolute;
left:0;
right:250px;
bottom:30px;
top:50px;
background:red;
z-index:0;
overflow-y:scroll;
}
//right col
#menu {
position:absolute;
right:0;
top:50px;
width:250px;
bottom:30px;
background:#yellow;
}
#handle {
position:absolute;
right:250px;
top:50px;
width:10px;
bottom:30px;
background:blue;
cursor: col-resize;
z-index:5;
}
My directive is empty at the moment on the fiddle - how can I target the two column divs in the directive so that if I drag the handle div I can change the widths of the two columns?
var myApp = angular.module('myApp', []);
myApp.directive("draggable", function(){
return {
restrict: 'A',
link: function (scope, element, attrs) {
element.on('click', function () {
//do something here
});
}
};
});