开发者

jQuery sortable plugin problem

开发者 https://www.devze.com 2023-01-31 23:06 出处:网络
I am using jQuery\'s sortable plugin to sort some lists. The lists I have are a lot, making the page scroll.

I am using jQuery's sortable plugin to sort some lists.

The lists I have are a lot, making the page scroll.

The problem is that when I click to drag an element that is in a portion of the page that has been scrolled, the plugin seems to not be able to calculate correctly the element's top offset.

As a result, the mouse is on one point of the page and the element is on an other. The element is being drag开发者_高级运维ged but it is not under the mouse.

Inspecting with firebug while dragging the element, I see that the top attribute is not correct. It is, as if the plugin does not calculate the body scroll.

Anyone experienced something similar?

Thanks


Just found it

I had position : relative to the ul that contained the li's.

That was the culprit. Removing it, fixed it

Hope it will help someone in the future

0

精彩评论

暂无评论...
验证码 换一张
取 消