我正在使用可拖动和可排序的列表来拖动和排序它们之间的项目。 但是,我拥有的物品是可滑动的(即点击它们的dhows / hides内容)。 当我将项目从一个列表拖动到另一个列表时,滑动效果会丢失。 此外,如果我有一个隐藏其子节点的项目,并将项目拖动到另一个列表,则只拖动该项目(没有任何子项内容)。 这是代码
http://jsbin.com/ujivav/1/edit
I am using draggable and sortable lists to have items dragged and sorted between them. However, the items I have are slidable (i.e. clicking on them dhows/hides content). When I drag an item from one list to another, the sliding effect is lost. Also, if I have a item with its children nodes hidden, and I drag the item to another list, only the item (without any children content) is dragged. Here is the code
http://jsbin.com/ujivav/1/edit
最满意答案
KHY是正确的,但您也可以更改要使用的click事件,如下所示:
$('body').on('click', '.clicktohide',function(){ $(this).siblings().slideToggle('fast'); });这是一个例子http://jsbin.com/ujivav/4/edit
KHY is correct, but you could also change the click event to use on instead, like so:
$('body').on('click', '.clicktohide',function(){ $(this).siblings().slideToggle('fast'); });Here's an example http://jsbin.com/ujivav/4/edit
更多推荐
发布评论