【问题标题】:fullcalendar draggable events easing on remaining DIVsfullcalendar 可拖动事件在剩余 DIV 上缓和
【发布时间】:2012-06-04 06:53:16
【问题描述】:

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

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

【问题讨论】:

    标签: jquery events draggable external slideup


    【解决方案1】:

    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/

    【讨论】:

    • 谢谢一百万。奇迹般有效。你是救生员!
    • 对不起,我太菜鸟了,我什至没有头脑接受你的回答。现在接受答案,再次感谢。
    猜你喜欢
    • 2012-08-16
    • 1970-01-01
    • 2022-01-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-19
    • 1970-01-01
    相关资源
    最近更新 更多