I'm using jQuery draggable and droppable for a work-planning system I'm developing. Users drag jobs to a different day or user, and then data is updated using an ajax call.
Everything works fine, except when I scroll down the main page (Jobs appear on a large week planner that exceeds the bottom of my browser window). If I try and drag a draggable element here, the element appears above my mouse cursor the same amount of pixels as I've scrolled down.. The hover state still works fine and the functionality is bang on but it doesn't look right.
I'm using jQuery 1.6.0 and jQuery UI 1.8.12.
我确信我需要添加一个偏移函数,但我不知道在哪里应用它,或者是否有更好的方法.这是我的.draggable()
初始化代码:
$('.job').draggable({
zIndex: 20,
revert: 'invalid',
helper: 'original',
distance: 30,
refreshPositions: true,
});
Any idea what I can do to fix this?