I am using jquery to dynamically enable or disable snap.js like this:
$(window).resize(function () {
if ($(window).width() < 1024) {
snapper.enable();
} else {
snapper.disable();
}
});
But this doesnt seem to work. I think this has something to to with not using the event handler but i have no idea how.
thanks in advance!
edit:
this also doesnt seem to work:
addEvent(window, 'resize', function(){
if ($(window).width() < 1024) {
snapper.on('drag');
} else {
snapper.off('drag');
}
});