Skip to content

Instantly share code, notes, and snippets.

@shortcircuit3
Last active January 4, 2016 19:19
Show Gist options
  • Save shortcircuit3/8666573 to your computer and use it in GitHub Desktop.
Save shortcircuit3/8666573 to your computer and use it in GitHub Desktop.
Toggle between two framer.js funcitons
var init = function() {
alert('init');
}
var run = function() {
alert('hi');
}
// Check pointer types
pointerType = "click";
// Trigger animation on click/tap anywhere
toggler = utils.cycle(init, run);
PSD.content.on(pointerType, function(e) {
var animate;
e.preventDefault();
animate = toggler();
return animate();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment