briangonzalez / jquery.pep.js

👟 Pep, a lightweight plugin for kinetic drag on mobile/desktop
http://pep.briangonzalez.org
1.3k stars 178 forks source link

no revert if throwing object #164

Closed pixelsmill closed 7 years ago

pixelsmill commented 9 years ago

Hi there,

Pep is seems really good, thanks for sharing ;)

I have a problem, maybe it's not a bug, but this behavior seems strange to me. If I drag then move and drop, it reverts well, cool ;)) But if I drop it while moving, my object keeps moving then stop and never come back... Please come back !!

Am I doing something wrong ? My code is really simple :

$('.ingredients img').pep({
    droppable: '.questions',
    constrainTo: 'parent',
    revert: true,
    revertIf: function(){
        return !this.activeDropRegions.length;
    }
});

How can I solve this ? Maybe I should code revert move without pep ?