Setting boundary limits for a draggable object

前端 未结 4 478
借酒劲吻你
借酒劲吻你 2020-12-31 18:53

I have two elements:

1. A parent of fixed height, overflow:hidden

2. Its child, of larger fixed height.

4条回答
  •  醉酒成梦
    2020-12-31 19:49

    Use the containment option:

    $('.myList').draggable({
        axis: 'y',
        containment: 'parent'
    });
    

提交回复
热议问题