jQuery sortable item height

后端 未结 3 1325
灰色年华
灰色年华 2021-02-04 14:25

I\'ve got a simple jQuery sortable based on a list as follows:

  • Item 1
  • Item 2
  • Item 3
3条回答
  •  时光取名叫无心
    2021-02-04 15:01

    You could grab the current height of the Div being dragged, save it in a variable and assign a generic height to the DIV being dragged. Once it's placed, use the call back to reassign the height within the variable.

    var curHeight = $(div).height();  
    
    $(div).css({height: 20px;});
    

    You may also want to consider forceHelperSize

提交回复
热议问题