开发者

jQuery: problem with sortable items: can't be dropped onto empty lists

Here is an example double list thing: http://jsfiddle.net/xhdUW/

If one of the parent lists already has content, the list items will transfer between the parent lists easily. But if one of the parent lists is empty, the list items will not go into the empty parent list.

The docs on .sortable say t开发者_如何学运维hat transferring to empty lists should be enabled by default: http://jqueryui.com/demos/sortable/#empty-lists , though, even when I specify dropOnEmpty: true, I get the same behavior.


Your empty list have no height and no vertical padding. Try to add something from list:
padding-top
padding-bottom
min-height


You have heavily abused the sortable API. See http://jsfiddle.net/6xkQE/ how it gets done right.

  1. You have to use connectWith with what you want to connect!

  2. As @hadvig mentioned, you have to set min-height!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜