开发者

Is there any reason why jQuery Sortable would work in IE/Chrome but not Firefox?

开发者 https://www.devze.com 2023-02-02 09:49 出处:网络
I have a fairly straightforward list of horizontally floated items, like this: <div class=\"my-widget-container\">

I have a fairly straightforward list of horizontally floated items, like this:

<div class="my-widget-container">
    <div class="my-widget-column">...</div>
    ...
</div>

Both the container and each column have a fixed width, set using jQuery's .width(). The container is position: relative and the column is float: left and overflow: hidden. Not sure if any other styles/properties are relevant.

When I apply a jQuery-UI sortable to this, the result is exactly what I'd expect in Chome 8 and IE 8; the columns can be dragged around to change their order. But in Firefox 3.6 I can click an item and drag to create a new sort-helper, yet the actual sort never happens; the real item's position in the DOM never changes.

I dug around a little in Sortable, and added a debug print to _intersectsWithPointer. Whenever the drag helper moves, Sortable runs through its list of elements and uses this method to determine whether the drag helper has passed over one. What I saw was that item.left had the same value for all my columns, which is obviously not correct, and probably the source of the problem. It looks like all columns had a left position corresponding to that开发者_高级运维 of the first column.

I'm using jQuery 1.4.3 and jQuery UI Sortable 1.8. Those aren't the very latest versions, but they're pretty recent, and I don't see anything in the Sortable release notes that indicates any such problem has been fixed.

Does anyone know what might be happening here, or have any ideas for further debugging?

0

精彩评论

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