I have a problem with a jQuery UI 1.7.2 sortable list in Firefox 3.6, IE7-8 work fine. When I\'m scrolled down a bit, the helper element seems to have an offset of the same
If you want to prevent browser sniffing, the CSS only solution is to set the ul or a container style to overflow: auto
. If you look at the source through firebug, it's the way jQuery does it in their example.
I "fixed" this using newer jQuery/jQuery UI versions.
I also had this problem and fixed it with the following code:
var wscrolltop = 0;
$sortable_elements.sortable({
start: function(event, ui) {
wscrolltop = $(window).scrollTop();
},
sort: function(event, ui) {
ui.helper.css({'top' : ui.position.top + wscrolltop + 'px'});
}
});
I discovered, that there still is a problem if you scroll with your sortable-element. Maybe somebody has a solution for this?
UPDATE: The fix is:
$sortable_elements.sortable({
connectWith: '#personal-favs ul.fitems',
sort: function(event, ui) {
ui.helper.css({'top' : ui.position.top + $(window).scrollTop() + 'px'});
}
});
But still - if you're leaving the list, the sort-event seems to stop.