I have an outer div and an inner div. The inner div can be dragged vertically, and the outer div can be dragged horizontally. I did it ( http://jsfiddle.net/27Nh2/ )
Now I also want the outer div to be moved horizontally if the user tries to drag the inner div horizontally. The inner div should remain where it is inside the outer div, and the outer div horizontally.
The problem is that I'm trying to drag the inner div horizontally, nothing is being dragged.
<div class="slides">
Outer - only drag horizontally
<div class="slide">
Inner - only drag vertically
</div>
</div>
.slides {
margin:20px;
background-color:#aaa;
cursor:pointer;
width:200px;
height:100px;
}
.slide {
width:100px;
height:200px;
margin:20px;
background-color:#ccc;
}
$(".slides").draggable({
axis:"x",
});
$(".slide").draggable({
axis:"y",
});
source
share