fullcalendar可拖动事件缓解剩余的DIV

时间:2012-06-04 06:53:17

标签: jquery events draggable external slideup

http://arshaw.com/js/fullcalendar-1.5.3/demos/external-dragging.html

在上面的fullcalendar演示中,来自单独DIV(侧边栏)的外部事件可以拖动并可以拖放到日历中,当勾选“删除后删除”框后,拖放事件会从列表中删除日历。我想在删除事件时向可拖动事件侧边栏中剩下的其他DIV添加缓动或类似效果,以便查看者知道从列表中删除了某些内容。是否有一种jquery方法可以将剩余项目(DIV)滑动到已删除的项目下方,这样,如果我将事件3拖到日历中,事件4和5将向上移动,事件4将取代事件3,并且第5项活动代替活动4?我该怎么做?请向菜鸟解释。谢谢!

1 个答案:

答案 0 :(得分:0)

demo使用此代码删除已删除的事件

 // is the "remove after drop" checkbox checked?
if ($('#drop-remove').is(':checked')) {
    // if so, remove the element from the "Draggable Events" list
    $(this).remove();
}

$(this).remove()更改为:

$(this).slideUp(function(){
     $(this).remove();
 });

slideUp()方法将为列表中的事件崩溃设置动画

jQuery API参考:http://api.jquery.com/slideUp/