2015-06-23 33 views
0

我在構建管理項目的前端部分。現在我正在處理頁面概述,您可以在其中對頁面進行排序(作爲列表)。我正在使用jquery插件nestedSortable,from here,以獲得樹視圖功能。在滾動條上排序的奇怪行爲jquery

我的問題:如果頁面已經滾動,你開始拖動/排序的項目被定位爲從鼠標而不是鼠標滾動下來的像素量,因爲它應該是(滾動前拖動/排序)。

我對排序列表選項如下:

var ns = $('.sortable-list').nestedSortable({ 
    forcePlaceholderSize: true, 
    handle: '.handle', 
    helper: 'clone', 
    items: 'li', 
    opacity: .9, 
    placeholder: 'sort-placeholder', 
    revert: 250, 
    tabSize: 15, 
    tolerance: 'pointer', 
    toleranceElement: '> div', 
    maxLevels: 4, 
    isTree: true, 
    expandOnHover: 700, 
    startCollapsed: true, 
    stop: function() { 
    updateList(); 
    setTimeout(updateList, 100); 
    } 
}); 

I also made a codepen thats illustrate my problem.

不要任何人知道如何解決這個問題? - 先謝謝你。

回答

0

我相信這是nestedSortable庫中的一個bug。 git存儲庫上有一個提交表明它應該修復該錯誤(https://github.com/ilikenwf/nestedSortable/commits/2.0alpha),所以請嘗試升級到最新版本,看看是否可以解決您的問題。

更新:實際上,修改您的CodePen使用該文件的最新版本的作品:http://codepen.io/anon/pen/yNPWKX

我用於CodePen的nestedSortable源文件是:

<script src='http://mjsarfatti.com/sandbox/nestedSortable/jquery.mjs.nestedSortable.js'></script> 
+0

你,先生,現在我的新farvorite的人在這個世界上。謝謝你數百萬次。 – Legarndary