jQuery排序溢出:隐藏;在两个名单之间 [英] jQuery sortable with overflow: hidden; between two lists

查看:66
本文介绍了jQuery排序溢出:隐藏;在两个名单之间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个使用jQuery排序的列表,我可以在它们之间移动项目。

  $('#productsList,#orderList')
.sortable({connectWith:'.containerDiv'})
.disableSelection();

然而,当我想使用自定义滚动条并将 overflow:hidden; 在这两个列表上。我希望他们与 max-height:400px
如果我设置了溢出隐藏我不能看到后,我把它们拖到一个div之外的项目,如果我不设置隐藏列表将有默认滚动条。
任何人都可以提出解决方案。



谢谢

解决方案

如果从列表中删除样式位置:相对似乎可以按照您的要求运行。



http://jsfiddle.net/cCDcQ/2/



编辑

我会认为使用appendTo选项可以解决这个问题,我是对的。稍微摆弄一下之后,我就开始工作了。这样,如果您需要,您可以保留位置:相对



http://jsfiddle.net/cCDcQ/4/

I have two lists in which using jQuery sortable i can move the items between them.

$( '#productsList, #orderList' )
.sortable({connectWith: '.containerDiv'})
.disableSelection();

However I run into a problem when i want to use custom scroll bar and set overflow:hidden; on the two lists. I want them to be with max-height:400px. If i set overflow hidden i cant see the items after i drag them outside of one div, If i dont set hidden the list will have default scroll bar. Can anyone suggest a solution.

thanks

解决方案

If you remove the style position:relative from your lists is seems to work as you want it to.

http://jsfiddle.net/cCDcQ/2/

Edit:

I would have thought that using the appendTo option would fix this issue and I was right. After a bit more fiddling, I got it to work. This way, you can keep the position:relative if you need it.

http://jsfiddle.net/cCDcQ/4/

这篇关于jQuery排序溢出:隐藏;在两个名单之间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆