Last active
January 4, 2016 19:19
-
-
Save shortcircuit3/8666573 to your computer and use it in GitHub Desktop.
Toggle between two framer.js funcitons
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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