jQuery Sortable List - scroll bar jumps up when sorting

后端 未结 13 1130
慢半拍i
慢半拍i 2020-12-24 12:28

I created a demo: http://pastebin.me/584b9a86d715c9ba85b7bebf0375e237

When the scroll bar is at the bottom and you drag items to sort them, it causes the scroll bar

13条回答
  •  春和景丽
    2020-12-24 13:19

    I have experienced this issue as well. It happens when the list dictates the length of your page. When you start sorting, the list height changes for a split second, causing the page to jump. Here is an odd, but very functional solution to this problem:

    $('ul').height($('ul').height());
    

提交回复
热议问题