Created
November 24, 2015 15:58
-
-
Save ericakfranz/ca12b98e3e4dd48c089c to your computer and use it in GitHub Desktop.
Assign the escape key to exit an optin. ikhc6rkql15ly9mx = optin's slug
This file contains hidden or 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
$(document).keyup(function(e) { | |
if (e.keyCode == 27) { // escape key maps to keycode `27` | |
if( typeof window.ikhc6rkql15ly9mx !=='undefined') { | |
window.ikhc6rkql15ly9mx.close(true); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment