A simple situation is two divs and one div, which is a field. The outer div scrolls. Div.box resizes (w, e). When I try to resize from right to left, div.box is compressed to a width: 0px.
Here is an example: code
I already read all about jquery-ui resizable, but can't find a solution for me. I would appreciate any help.
HTML:
<div class="container-scroll">
<div class="container">
<div class="box"></div>
</div>
</div>
CSS
.container-scroll {
display:block;
width:500px;
height:100px;
overflow:scroll;
border:1px solid #666;
}
.container {
display:block;
position:relative;
width:1000px;
height:100px;
padding:20px 0;
background-color:#eee;
}
.box {
display:block;
position:absolute;
width:1000px;
left:0;
height:50px;
background:red;
}
JavaScript:
$('.box').resizable({
containment: 'parent',
handles: 'w, e',
grid: [10,10]
});
source
share