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

Unbind not working properly...? #169

Closed pix0id closed 9 years ago

pix0id commented 9 years ago

I'm possibly doing this wrong, but I'm trying to set a button to toggle the pep Grid feature on/off. Unless there's an easier way to do this, I'm trying to use $.pep.unbind($('.item')); to stop Pep, then re-enable pep with $('.item').pep({ ... }); with the grid settings enabled.

What ends up happening is, there are multiple instances of Pep on the same items, so they'll drag regularly, but then snap to the grid.

Is there an easy way to toggle options like this?

pix0id commented 9 years ago

Nevermind, I was actually doing it wrong.